Compare commits
No commits in common. 'master' and 'glusterfs-api' have entirely different histories.
master
...
glusterfs-
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="test"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="jst.web"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
|
||||
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/junit-4.12.jar"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
@ -0,0 +1,5 @@
|
||||
/target
|
||||
/build
|
||||
.classpath
|
||||
|
||||
/bin/
|
@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
performed.operation.correct.unbound.jre=1.0
|
||||
performed.operation.resolve.unknown.runtime=1.0
|
@ -1,2 +1,5 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//WebContent/WEB-INF/config/config.properties=UTF-8
|
||||
encoding//src/com/platform/utils/GanymedSSH.java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
separateDerivedEncodings=true
|
||||
|
@ -1,7 +1,101 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||
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.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.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
|
@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jpt.core.platform=generic2_1
|
||||
org.eclipse.jpt.jpa.core.discoverAnnotatedClasses=false
|
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="data-aggregation-platform">
|
||||
<wb-module deploy-name="data_manager_backend">
|
||||
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/test"/>
|
||||
<property name="java-output-path" value="/data-aggregation-platform/build/classes"/>
|
||||
<property name="java-output-path" value="/data_manager_backend/build/classes"/>
|
||||
<property name="context-root" value="/"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<root>
|
||||
<facet id="jpt.jpa">
|
||||
<node name="libprov">
|
||||
<attribute name="provider-id" value="jpa-no-op-library-provider"/>
|
||||
</node>
|
||||
</facet>
|
||||
</root>
|
@ -1,10 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<runtime name="Apache Tomcat v7.0"/>
|
||||
<runtime name="MyEclipse Tomcat v7.0"/>
|
||||
<fixed facet="java"/>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<fixed facet="jst.web"/>
|
||||
<installed facet="java" version="1.7"/>
|
||||
<installed facet="jst.web" version="3.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="jpt.jpa" version="2.1"/>
|
||||
</faceted-project>
|
||||
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
function ergodic(){
|
||||
for file in `ls $1`
|
||||
do
|
||||
if [ "$file" != "app" -a -d $1"/"$file ]
|
||||
then
|
||||
ergodic $1"/"$file
|
||||
else
|
||||
local path=$1"/"$file
|
||||
echo $path
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
IFS=$'\n' #这个必须要,否则会在文件名中有空格时出错
|
||||
INIT_PATH=".";
|
||||
ergodic $1
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,23 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#btn").{"name":"伍名"}click(function(){
|
||||
$.post("json",function(data){
|
||||
alert(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form action="hello" method="post">
|
||||
name:<input type="text" name="name">
|
||||
<input type="submit" value="submit">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||||
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.platform.dao.DataInfoDao">
|
||||
<resultMap id="getEntityByText" type="DataInfoEntity">
|
||||
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
||||
<result property="regionalismCode" column="regionalism_code"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="cityName" column="city_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="districtName" column="district_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="systemCode" column="system_code" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="systemName" column="system_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataType" column="data_type" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataVersion" column="data_version" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="submittedBatch" column="submitted_batch"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="dataPath" column="data_path" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="charset" column="data_charset" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="collectingTime" column="collection_time"
|
||||
javaType="string" jdbcType="DATE" />
|
||||
<result property="collectorContacts" column="collector_contacts"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="collectorName" column="collector_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="year" column="data_year" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="conditionsFilters">
|
||||
<if test="PagerOptions!=null">
|
||||
<where>
|
||||
<if test="PagerOptions.dataType!=null">
|
||||
and data_details.data_type=#{PagerOptions.dataType}
|
||||
</if>
|
||||
<if test="PagerOptions.submittedBatch!=null">
|
||||
and
|
||||
data_details.submitted_batch=#{PagerOptions.submittedBatch}
|
||||
</if>
|
||||
<if test="PagerOptions.cityName!=null">
|
||||
and data_details.city_name=#{PagerOptions.cityName}
|
||||
</if>
|
||||
<if test="PagerOptions.districtName!=null">
|
||||
and
|
||||
data_details.district_name=#{PagerOptions.districtName}
|
||||
</if>
|
||||
<if test="PagerOptions.dataVersion">
|
||||
and
|
||||
data_details.data_version=#{PagerOptions.dataVersion}
|
||||
</if>
|
||||
<if test="PagerOptions.systemName">
|
||||
and data_details=#{PagerOptions.systemName}
|
||||
</if>
|
||||
<if test="PagerOptions.dataYear">
|
||||
and data_details.data_year=#{PagerOptions.dataYear}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="PagerOptions.idIndex>0">
|
||||
and data_details.id>=#{idIndex}
|
||||
</when>
|
||||
<otherwise>
|
||||
and data_details.id>=0
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
ORDER BY data_details.id
|
||||
<if test="PagerOptions.limit">LIMIT #{PagerOptions.limit}</if>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="getLimitedDataInfoEntities" parameterType="PagerOptions"
|
||||
resultMap="getEntityByText">
|
||||
SELECT
|
||||
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,data_year
|
||||
FROM data_details
|
||||
<include refid="conditionsFilters" />
|
||||
</select>
|
||||
|
||||
<select id="getLimitedDataCount" resultType="java.lang.Integer"
|
||||
parameterType="PagerOptions">
|
||||
SELECT COUNT(id) FROM data_details
|
||||
<include refid="conditionsFilters" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,64 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/tx
|
||||
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
||||
http://www.springframework.org/schema/aop
|
||||
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
<!-- 读取db.properties中的属性值 -->
|
||||
<bean
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location" value="/WebContent/WEB-INF/config/config.properties"></property>
|
||||
</bean>
|
||||
|
||||
<!-- 连接MySQL数据库 -->
|
||||
<bean id="mySQLDataSource"
|
||||
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="driverClassName" value="${jdbc.mysql.driver}" />
|
||||
<property name="url" value="${jdbc.mysql.url}" />
|
||||
<property name="username" value="${jdbc.mysql.username}" />
|
||||
<property name="password" value="${jdbc.mysql.password}" />
|
||||
</bean>
|
||||
<bean id="mySQLSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
||||
<property name="configLocation" value="/WebContent/WEB-INF/config/mybatis-applicationConfig.xml" />
|
||||
<property name="dataSource" ref="mySQLDataSource" />
|
||||
</bean>
|
||||
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
||||
<property name="basePackage" value="com.platform.dao" />
|
||||
</bean>
|
||||
|
||||
<!-- 配置声明式事物 -->
|
||||
<bean id="mySQLTxManager"
|
||||
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<property name="dataSource" ref="mySQLDataSource" />
|
||||
</bean>
|
||||
<tx:advice id="txAdvice" transaction-manager="mySQLTxManager">
|
||||
<tx:attributes>
|
||||
<tx:method name="delete*" propagation="REQUIRED" />
|
||||
<tx:method name="insert*" propagation="REQUIRED" />
|
||||
<tx:method name="update*" propagation="REQUIRED" />
|
||||
<tx:method name="get*" read-only="true" />
|
||||
<tx:method name="select*" read-only="true" />
|
||||
</tx:attributes>
|
||||
</tx:advice>
|
||||
<aop:config>
|
||||
<aop:pointcut expression="execution(* com.platform.service.*.*(..))"
|
||||
id="pointcut" />
|
||||
<aop:advisor advice-ref="txAdvice" pointcut-ref="pointcut" />
|
||||
</aop:config>
|
||||
<bean id="user" class="com.platform.test.User">
|
||||
<property name="name" value="伍名" />
|
||||
<property name="id" value="1" />
|
||||
<property name="sex" value="男" />
|
||||
</bean>
|
||||
<context:component-scan base-package="com.platform.*">
|
||||
<context:exclude-filter type="annotation"
|
||||
expression="org.springframework.stereotype.Controller" />
|
||||
</context:component-scan>
|
||||
</beans>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
|
||||
<persistence-unit name="aggregation-platform">
|
||||
</persistence-unit>
|
||||
</persistence>
|
@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||||
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.platform.dao.GatherOracleDao">
|
||||
<resultMap type="com.platform.entities.GatherOracleInfo" id="getEntityBytext">
|
||||
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
||||
<result property="port" column="service_port" javaType="int" jdbcType="INTEGER"/>
|
||||
<result property="ip" column="service_ip" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="service_name" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="user" column="service_user" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="password" column="service_password" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="databaseName" column="service_database" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="tableName" column="service_table" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="suffix" column="service_suffix" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="service_status" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="remove" column="remove" jdbcType="CHAR"/>
|
||||
</resultMap>
|
||||
<sql id="baseOracleInfo">
|
||||
id id, service_port port, service_ip ip, service_name name, service_user user, service_password password, service_database databaseName, service_table tableName, service_suffix suffix, service_status status
|
||||
</sql>
|
||||
|
||||
<select id="selectAllOracle" resultType="com.platform.entities.GatherOracleInfo">
|
||||
SELECT
|
||||
<include refid="baseOracleInfo" />
|
||||
FROM services_info
|
||||
WHERE remove = "0"
|
||||
</select>
|
||||
|
||||
<insert id="insertOracle" parameterType="com.platform.entities.GatherOracleInfo">
|
||||
INSERT INTO
|
||||
services_info(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="port > 0">
|
||||
service_port,
|
||||
</if>
|
||||
<if test="ip != null and ip != ''">
|
||||
service_ip,
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
service_name,
|
||||
</if>
|
||||
<if test="user != null and user != ''">
|
||||
service_user,
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
service_password,
|
||||
</if>
|
||||
<if test="databaseName != null and databaseName != ''">
|
||||
service_database,
|
||||
</if>
|
||||
<if test="tableName != null and tableName != ''">
|
||||
service_table,
|
||||
</if>
|
||||
<if test="suffix != null and suffix != ''">
|
||||
service_suffix,
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
service_status,
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
VALUES(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="port > 0">
|
||||
#{port},
|
||||
</if>
|
||||
<if test="ip != null and ip != ''">
|
||||
#{ip},
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="user != null and user != ''">
|
||||
#{user},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
#{password},
|
||||
</if>
|
||||
<if test="databaseName != null and databaseName != ''">
|
||||
#{databaseName},
|
||||
</if>
|
||||
<if test="tableName != null and tableName != ''">
|
||||
#{tableName},
|
||||
</if>
|
||||
<if test="suffix != null and suffix != ''">
|
||||
#{suffix},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
#{status},
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteOracleById" parameterType="java.lang.Integer">
|
||||
DELETE FROM services_info
|
||||
<where>
|
||||
id =#{id}
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<update id="updateOracleById" parameterType="com.platform.entities.GatherOracleInfo">
|
||||
UPDATE
|
||||
services_info
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="name != null and name != ''">
|
||||
service_name = #{name},
|
||||
</if>
|
||||
<if test="ip != null and ip != ''">
|
||||
service_ip = #{ip},
|
||||
</if>
|
||||
<if test="port > 0">
|
||||
service_port= #{port},
|
||||
</if>
|
||||
<if test="user != null and user != ''">
|
||||
service_user= #{user},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
service_password= #{password},
|
||||
</if>
|
||||
<if test="databaseName != null and databaseName != ''">
|
||||
service_database= #{databaseName},
|
||||
</if>
|
||||
<if test="tableName != null and tableName != ''">
|
||||
service_table= #{tableName},
|
||||
</if>
|
||||
<if test="suffix != null and suffix != ''">
|
||||
service_suffix= #{suffix},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
service_status= #{status},
|
||||
</if>
|
||||
<if test="remove != null and remove != ''">
|
||||
remove= #{remove},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
id = #{id}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,208 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||||
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.platform.dao.DataInfoDao">
|
||||
<resultMap id="getEntityByText" type="DataInfoEntity">
|
||||
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
||||
<result property="regionalismCode" column="regionalism_code"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="cityName" column="city_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="districtName" column="district_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="systemCode" column="system_code" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="systemName" column="system_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataType" column="data_type" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataVersion" column="data_version" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="submittedBatch" column="submitted_batch"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="dataPath" column="data_path" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="charset" column="data_charset" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="collectingTime" column="collection_time"
|
||||
javaType="string" jdbcType="DATE" />
|
||||
<result property="collectorContacts" column="collector_contacts"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="collectorName" column="collector_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="year" column="data_year" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="conditionsFilters">
|
||||
<if test="PagerOptions.dataType!=null">
|
||||
and data_details.data_type=#{PagerOptions.dataType}
|
||||
</if>
|
||||
<if test="PagerOptions.submittedBatch!=null">
|
||||
and
|
||||
data_details.submitted_batch=#{PagerOptions.submittedBatch}
|
||||
</if>
|
||||
<if test="PagerOptions.cityName!=null">
|
||||
and data_details.city_name=#{PagerOptions.cityName}
|
||||
</if>
|
||||
<if test="PagerOptions.districtName!=null">
|
||||
and
|
||||
data_details.district_name=#{PagerOptions.districtName}
|
||||
</if>
|
||||
<if test="PagerOptions.dataVersion !=null">
|
||||
and data_details.data_version=#{PagerOptions.dataVersion}
|
||||
</if>
|
||||
<if test="PagerOptions.systemName !=null">
|
||||
and data_details=#{PagerOptions.systemName}
|
||||
</if>
|
||||
<if test="PagerOptions.dataYear !=null">
|
||||
and data_details.data_year=#{PagerOptions.dataYear}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!-- 获取数据符合筛选条件的全部记录信息 -->
|
||||
<select id="getLimitedDataInfoEntities" parameterType="PagerOptions"
|
||||
resultMap="getEntityByText">
|
||||
SELECT
|
||||
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,data_year
|
||||
FROM data_details
|
||||
<if test="PagerOptions!=null">
|
||||
<where>
|
||||
<include refid="conditionsFilters" />
|
||||
<choose>
|
||||
<when test="PagerOptions.offset > 0">
|
||||
and data_details.id>= #{PagerOptions.offset}
|
||||
</when>
|
||||
<otherwise>
|
||||
and data_details.id>=0
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
|
||||
ORDER BY data_details.id
|
||||
<if test="PagerOptions.limit > 0">
|
||||
LIMIT #{PagerOptions.limit}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 获取数据符合筛选条件的总记录条数 -->
|
||||
<select id="getLimitedDataCount" resultType="java.lang.Integer"
|
||||
parameterType="PagerOptions">
|
||||
SELECT COUNT(id) FROM data_details
|
||||
<if test="PagerOptions!=null">
|
||||
<where>
|
||||
<include refid="conditionsFilters" />
|
||||
</where>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 获取数据查询的起始di -->
|
||||
<select id="getLimitedBeginId" resultType="java.lang.Integer"
|
||||
parameterType="PagerOptions">
|
||||
SELECT MAX(idx) FROM (SELECT id idx FROM data_details
|
||||
ORDER BY id LIMIT 0,#{PagerOptions.totalLimit}) AS TEMP
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.platform.entities.DataInfoEntity">
|
||||
INSERT INTO
|
||||
data_info(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="regionalismCode != null and regionalismCode != ''">
|
||||
regionalism_code,
|
||||
</if>
|
||||
<if test="systemCode > 0">
|
||||
system_code,
|
||||
</if>
|
||||
<if test="dataType != null and dataType != ''">
|
||||
data_type,
|
||||
</if>
|
||||
<if test="dataVersion != null">
|
||||
data_version,
|
||||
</if>
|
||||
<if test="submittedBatch != null and submittedBatch != ''">
|
||||
submitted_batch,
|
||||
</if>
|
||||
<if test="dataPath != null and dataPath != ''">
|
||||
data_path,
|
||||
</if>
|
||||
<if test="collectingTime != null">
|
||||
collection_time,
|
||||
</if>
|
||||
<if test="collectorName != null and collectorName != ''">
|
||||
collector_name,
|
||||
</if>
|
||||
<if test="collectorContacts != null and collectorContacts != ''">
|
||||
collector_contacts,
|
||||
</if>
|
||||
<if test="charset != null and charset != ''">
|
||||
data_charset,
|
||||
</if>
|
||||
<if test="year != null and year != ''">
|
||||
data_year
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
VALUES(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="regionalismCode != null and regionalismCode != ''">
|
||||
#{regionalismCode},
|
||||
</if>
|
||||
<if test="systemCode != null">
|
||||
#{systemCode},
|
||||
</if>
|
||||
<if test="dataType != null and dataType != ''">
|
||||
#{dataType},
|
||||
</if>
|
||||
<if test="dataVersion != null">
|
||||
#{dataVersion},
|
||||
</if>
|
||||
<if test="submittedBatch != null and submittedBatch != ''">
|
||||
#{submittedBatch},
|
||||
</if>
|
||||
<if test="dataPath != null and dataPath != ''">
|
||||
#{dataPath},
|
||||
</if>
|
||||
<if test="collectingTime != null">
|
||||
#{collectingTime},
|
||||
</if>
|
||||
<if test="collectorName != null and collectorName != ''">
|
||||
#{collectorName},
|
||||
</if>
|
||||
<if test="collectorContacts != null and collectorContacts != ''">
|
||||
#{collectorContacts},
|
||||
</if>
|
||||
<if test="charset != null and charset != ''">
|
||||
#{charset},
|
||||
</if>
|
||||
<if test="year != null and year != ''">
|
||||
#{year}
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="getIdIsExist" parameterType="java.util.List" resultType="java.lang.String">
|
||||
select data_path
|
||||
from data_info
|
||||
where id in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and remove ='0'
|
||||
</select>
|
||||
|
||||
<update id="removes" parameterType="java.util.List">
|
||||
UPDATE
|
||||
data_info
|
||||
set remove = '1'
|
||||
where id in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and remove ='0'
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||||
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.platform.dao.DataInfoMoveTmpDao">
|
||||
<resultMap id="getEntityByText" type="com.platform.entities.DataInfoEntityMoveTmp">
|
||||
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
||||
<result property="regionalismCode" column="regionalism_code"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="cityName" column="city_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="districtName" column="district_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="systemCode" column="system_code" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="systemName" column="system_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataType" column="data_type" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataVersion" column="data_version" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="submittedBatch" column="submitted_batch"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="dataPath" column="data_path" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="charset" column="data_charset" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="collectingTime" column="collection_time"
|
||||
javaType="string" jdbcType="DATE" />
|
||||
<result property="collectorContacts" column="collector_contacts"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="collectorName" column="collector_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="year" column="data_year" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
|
||||
<result property="dstPath" column="dst_path" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="completeStatus" column="complete_status" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="rate" column="rate" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="lastTime" column="lasttime"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
regionalism_code,system_code,dst_path,lasttime
|
||||
</sql>
|
||||
|
||||
<!-- 获取数据全部记录信息 -->
|
||||
<select id="findAll" resultType="com.platform.entities.DataInfoEntityMoveTmp">
|
||||
SELECT
|
||||
a.id id,a.regionalism_code regionalismCode,b.city_name cityName,b.district_name districtName,
|
||||
a.system_code systemCode,b.system_name systemName,b.data_type dataType,b.data_version dataVersion,
|
||||
b.submitted_batch submittedBatch,b.data_path dataPath,b.data_charset charset,b.collection_time collectionTime,
|
||||
b.collector_name collectorName,b.collector_contacts collectorContacts,b.data_year dataYear,a.dst_path dstPath,
|
||||
a.complete_status completeStatus,a.rate rate, a.lasttime lastTime
|
||||
FROM
|
||||
move_data_tmp a LEFT JOIN data_details b
|
||||
ON a.system_code = b.system_code AND a.regionalism_code = b.regionalism_code
|
||||
ORDER BY a.id
|
||||
</select>
|
||||
|
||||
<update id="update" parameterType="com.platform.entities.DataInfoEntityMoveTmp">
|
||||
UPDATE
|
||||
move_data_tmp
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="dstPath != null and dstPath != ''">
|
||||
dst_path= #{dstPath},
|
||||
</if>
|
||||
<if test="completeStatus != null and completeStatus != ''">
|
||||
complete_status= #{completeStatus},
|
||||
</if>
|
||||
<if test="rate > 0">
|
||||
rate= #{rate},
|
||||
</if>
|
||||
<if test="lastTime != null and lastTime != ''">
|
||||
lasttime= #{lastTime},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
id = #{id}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<insert id="save" parameterType="com.platform.entities.DataInfoEntityMoveTmp">
|
||||
INSERT INTO
|
||||
move_data_tmp(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id > 0">
|
||||
id,
|
||||
</if>
|
||||
<if test="regionalismCode != null and regionalismCode != ''">
|
||||
regionalism_code,
|
||||
</if>
|
||||
<if test="systemCode != null">
|
||||
system_code,
|
||||
</if>
|
||||
<if test="dstPath != null and dstPath != ''">
|
||||
dst_path,
|
||||
</if>
|
||||
<if test="completeStatus != null and completeStatus != ''">
|
||||
complete_status,
|
||||
</if>
|
||||
<if test="rate > 0">
|
||||
rate,
|
||||
</if>
|
||||
<if test="lastTime != null and lastTime != ''">
|
||||
lasttime,
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
VALUES(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id > 0">
|
||||
id,
|
||||
</if>
|
||||
<if test="regionalismCode != null and regionalismCode != ''">
|
||||
#{regionalismCode},
|
||||
</if>
|
||||
<if test="systemCode != null and systemCode != ''">
|
||||
#{systemCode},
|
||||
</if>
|
||||
<if test="dstPath != null and dstPath != ''">
|
||||
#{dstPath},
|
||||
</if>
|
||||
<if test="completeStatus != null and completeStatus != ''">
|
||||
#{completeStatus},
|
||||
</if>
|
||||
<if test="rate > 0">
|
||||
#{rate}
|
||||
</if>
|
||||
<if test="lastTime != null and lastTime != ''">
|
||||
#{lastTime},
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO move_data_tmp ( <include refid="Base_Column_List" /> )
|
||||
VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.regionalismCode,jdbcType=VARCHAR},#{item.systemCode,jdbcType=INTEGER},#{item.dstPath,jdbcType=VARCHAR},#{item.lastTime,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="remove" parameterType="java.lang.Integer">
|
||||
DELETE FROM
|
||||
move_data_tmp
|
||||
WHERE
|
||||
id = #{id}
|
||||
</delete>
|
||||
<!-- 获取数据符合筛选条件的总记录条数 -->
|
||||
<!--
|
||||
<select id="getLimitedDataCount" resultType="java.lang.Integer"
|
||||
parameterType="PagerOptions">
|
||||
SELECT COUNT(id) FROM move_data_tmp
|
||||
<if test="PagerOptions!=null">
|
||||
<where>
|
||||
<include refid="conditionsFilters" />
|
||||
</where>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
获取数据查询的起始di
|
||||
<select id="getLimitedBeginId" resultType="java.lang.Integer"
|
||||
parameterType="PagerOptions">
|
||||
SELECT MAX(idx) FROM (SELECT id idx FROM move_data_tmp
|
||||
ORDER BY id LIMIT 0,#{PagerOptions.totalLimit}) AS TEMP
|
||||
</select> -->
|
||||
|
||||
</mapper>
|
@ -1,38 +1,265 @@
|
||||
package com.platform.controller;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.platform.entities.PagerOptions;
|
||||
import com.platform.service.DataInfoService;
|
||||
import com.platform.utils.UtilsHelper;
|
||||
|
||||
@Controller
|
||||
public class DataModelController {
|
||||
@Resource(name = "dataInfoService")
|
||||
private DataInfoService dfs;
|
||||
|
||||
public void setDfsImp(DataInfoService dfs) {
|
||||
this.dfs = dfs;
|
||||
}
|
||||
|
||||
@RequestMapping("/data.json")
|
||||
@ResponseBody
|
||||
public ModelMap getAllDataToJson(HttpServletRequest res, HttpServletResponse req) {
|
||||
Map<String, String[]> paramMap = res.getParameterMap();
|
||||
Set<String> keySet= paramMap.keySet();
|
||||
for(String str: keySet){
|
||||
System.out.println(str+":"+paramMap.get(str));
|
||||
}
|
||||
return dfs.getPagerTableData((PagerOptions) UtilsHelper.newObjAndSetAttrsByClass(PagerOptions.class, res));
|
||||
}
|
||||
}
|
||||
package com.platform.controller;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.base.BaseController;
|
||||
import com.platform.entities.DataInfoEntity;
|
||||
import com.platform.entities.DataInfoEntityMoveTmp;
|
||||
import com.platform.entities.FolderNode;
|
||||
import com.platform.entities.GatherOracleInfo;
|
||||
import com.platform.entities.OracleConnectorParams;
|
||||
import com.platform.entities.PagerOptions;
|
||||
import com.platform.entities.VolumeEntity;
|
||||
import com.platform.service.DataInfoService;
|
||||
import com.platform.service.IGfsService;
|
||||
import com.platform.service.IMoveDataService;
|
||||
import com.platform.service.IMySqlService;
|
||||
import com.platform.service.IOracleExtractService;
|
||||
import com.platform.service.OracleExtractHelper;
|
||||
import com.platform.service.OracleStatusService;
|
||||
import com.platform.service.impl.MySqlServiceImpl;
|
||||
import com.platform.test.Brick;
|
||||
import com.platform.test.FolderReader;
|
||||
import com.platform.test.Volume;
|
||||
import com.platform.utils.Bean2MapUtils;
|
||||
import com.platform.utils.Configs;
|
||||
import com.platform.utils.UtilsHelper;
|
||||
|
||||
@Controller
|
||||
public class DataModelController extends BaseController{
|
||||
@Resource(name = "dataInfoService")
|
||||
private DataInfoService dfs;
|
||||
|
||||
@Resource(name = "gfsService")
|
||||
private IGfsService gfsService;
|
||||
|
||||
@Resource(name = "mySqlService")
|
||||
private IMySqlService mySqlService;
|
||||
|
||||
@Resource(name = "OracleExtract")
|
||||
private IOracleExtractService OracleExtract;
|
||||
|
||||
@Resource(name = "moveDataService")
|
||||
private IMoveDataService moveDataService;
|
||||
|
||||
public void setDfsImp(DataInfoService dfs) {
|
||||
this.dfs = dfs;
|
||||
}
|
||||
|
||||
@RequestMapping("/data.json")
|
||||
@ResponseBody
|
||||
public ModelMap getAllDataToJson(HttpServletRequest res,
|
||||
HttpServletResponse req) throws UnsupportedEncodingException {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
Map<String, String[]> paramMap = res.getParameterMap();
|
||||
Set<String> keySet = paramMap.keySet();
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
StringBuffer sb = new StringBuffer().append("当前的请求参数:{");
|
||||
for (String str : keySet) {
|
||||
String value = paramMap.get(str)[0];
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
params.put(str, value);
|
||||
sb.append(str).append(":").append(value).append(",");
|
||||
} else {
|
||||
sb.append(str).append(":").append("null").append(",");
|
||||
}
|
||||
}
|
||||
Configs.CONSOLE_LOGGER.info(sb.deleteCharAt(sb.length() - 1)
|
||||
.append("}").toString());
|
||||
PagerOptions pagerOptions = (PagerOptions) UtilsHelper
|
||||
.newObjAndSetAttrsByClass(PagerOptions.class, params);
|
||||
|
||||
return dfs.getPagerTableData(pagerOptions);
|
||||
}
|
||||
|
||||
@RequestMapping(value="/delete/data", method= RequestMethod.POST)
|
||||
public void deleteData(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
Map<String, String[]> paramMap = res.getParameterMap();
|
||||
String[] data = paramMap.get("data");
|
||||
dfs.deleteData(data);
|
||||
}
|
||||
|
||||
@RequestMapping("/connectOracle")
|
||||
public void connectOracle(HttpServletRequest res, HttpServletResponse req) throws UnsupportedEncodingException {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
Map<String, String[]> paramMap = res.getParameterMap();
|
||||
String[] oraclesName = paramMap.get("oracleName");
|
||||
if (oraclesName != null)
|
||||
for (String rcName : oraclesName) {
|
||||
Configs.CONSOLE_LOGGER.info("连接成功\t" + rcName);
|
||||
new OracleStatusService().connectToOracle(rcName);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/cancelOracleConection")
|
||||
public void cancelOracleConnection(HttpServletRequest res,
|
||||
HttpServletResponse req) throws UnsupportedEncodingException {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
Map<String, String[]> paramMap = res.getParameterMap();
|
||||
String[] oraclesName = paramMap.get("oracleName");
|
||||
String operate = paramMap.get("operation")[0];
|
||||
if (null != oraclesName) {
|
||||
for (String rcName : oraclesName) {
|
||||
Configs.CONSOLE_LOGGER.info("取消连接:\t" + rcName);
|
||||
new OracleStatusService().cancelToOracle(rcName, operate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value="/oracle/{name}/extract", method= RequestMethod.POST)
|
||||
public void extractOracleData(HttpServletRequest res,
|
||||
HttpServletResponse req, String name) throws Exception {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
System.out.println("------extract-------");
|
||||
System.out.println(name);
|
||||
Map<String, String[]> paramMap = res.getParameterMap();
|
||||
//汇总库 对象信息--带有tableName-
|
||||
String[] nodes = paramMap.get("target");
|
||||
Map map = null;
|
||||
for (String string : nodes) {
|
||||
JSONObject jsonobject = JSONObject.fromObject(string);
|
||||
map = jsonobject;
|
||||
System.out.println(map);
|
||||
}
|
||||
|
||||
// 采集库对象--(多个采集库抽取到1个汇总库的1个tableName下)
|
||||
String[] inneed = paramMap.get("inneed");
|
||||
List<Map<String, String>> colleclist = new ArrayList<Map<String,String>>();
|
||||
for (String string : nodes) {
|
||||
JSONObject jsonobject = JSONObject.fromObject(string);
|
||||
Map inneedMap = jsonobject;
|
||||
colleclist.add(inneedMap);
|
||||
}
|
||||
OracleExtract.extractOracle(name, colleclist, map);
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value="/volume/list", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<VolumeEntity> getFolder(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
||||
System.out.println("get Request");
|
||||
// Brick brick1 = new Brick("192.168.0.101", "D:/bootstrap");
|
||||
// Brick brick2 = new Brick("192.168.0.103", "D:\book");
|
||||
// List<Brick> bricks = new ArrayList<Brick>();
|
||||
// bricks.add(brick1);
|
||||
// bricks.add(brick2);
|
||||
List<VolumeEntity> result = gfsService.getAllVolumes();
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/volume/{name}/move", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object move(HttpServletRequest res, HttpServletResponse req, String name,
|
||||
FolderNode selectNode, DataInfoEntity selectItems) throws Exception {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
System.out.println("get Request");
|
||||
Map<String, String[]> paramMap = res.getParameterMap();
|
||||
// System.out.println(paramMap);
|
||||
String[] nodes = paramMap.get("selectNode");
|
||||
Map map = null;
|
||||
for (String string : nodes) {
|
||||
System.out.println(string);
|
||||
JSONObject jsonobject = JSONObject.fromObject(string);
|
||||
map = jsonobject;
|
||||
}
|
||||
String dstVolume = (String) map.get("volume");
|
||||
|
||||
List<String> listItemPath = new ArrayList<String>();
|
||||
String[] items = paramMap.get("selectItems");
|
||||
System.out.println("selectItems");
|
||||
List<DataInfoEntity> datas = new ArrayList<DataInfoEntity>();
|
||||
List<String> srcVolumes = new ArrayList<String>();
|
||||
for (String string : items) {
|
||||
System.out.println(string);
|
||||
JSONObject jsobj = JSONObject.fromObject(string);
|
||||
Map itemmap = jsobj;
|
||||
if (null != itemmap.get("volume")) {
|
||||
srcVolumes.add((String) itemmap.get("volume"));
|
||||
}
|
||||
DataInfoEntity data = (DataInfoEntity) Bean2MapUtils.convertMap(DataInfoEntity.class, itemmap);
|
||||
datas.add(data);
|
||||
}
|
||||
System.out.println("------/volume/{name}/move--------");
|
||||
boolean result = false ;
|
||||
if (datas.size() >0) {
|
||||
result = moveDataService.moveData(datas, (String)map.get("path"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/oracle/list", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<GatherOracleInfo> getOracleInfo(HttpServletRequest res,
|
||||
HttpServletResponse req) throws Exception {
|
||||
|
||||
List<GatherOracleInfo> result = mySqlService.findAllMySql();
|
||||
System.out.println("----------getOracleInfo-----------------------");
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/oracle/{id}/delete", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public void deleteOracleInfo(HttpServletRequest res,
|
||||
HttpServletResponse req, int id) throws Exception {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
mySqlService.deleteMySql(id);
|
||||
System.out.println("----------deleteOracleInfo-----------------------");
|
||||
}
|
||||
|
||||
@RequestMapping(value="/oracle/{id}/insert", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public void insertOracleInfo(HttpServletRequest res,
|
||||
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
mySqlService.insertOracle(oracle);
|
||||
System.out.println("----------insertOracleInfo-----------------------");
|
||||
}
|
||||
|
||||
@RequestMapping(value="/oracle/{id}/update", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public void updateOracleInfo(HttpServletRequest res,
|
||||
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
||||
res.setCharacterEncoding("gb2312");
|
||||
System.out.println(oracle.getName());
|
||||
System.out.println(oracle);
|
||||
|
||||
mySqlService.updateOracle(oracle);
|
||||
System.out.println("----------updateOracleInfo-----------------------");
|
||||
}
|
||||
|
||||
@RequestMapping(value="/task/transfer/list", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object taskList() throws Exception {
|
||||
List<DataInfoEntityMoveTmp> result = moveDataService.findAll();
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/task/transfer/delete", method= RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object taskdeletes(DataInfoEntityMoveTmp move) throws Exception {
|
||||
int result = moveDataService.delete(move);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,32 @@
|
||||
|
||||
package com.platform.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.platform.utils.Configs;
|
||||
|
||||
@Controller
|
||||
public class DefaultController {
|
||||
|
||||
@RequestMapping("/")
|
||||
public ModelAndView defaultHandler(HttpServletRequest req, HttpServletResponse res){
|
||||
//处理不匹配的请求
|
||||
System.out.println("index");
|
||||
//处理不匹配的请求
|
||||
System.out.println("index");
|
||||
return new ModelAndView("index");
|
||||
}
|
||||
|
||||
@RequestMapping("/test")
|
||||
public ModelMap test(HttpServletRequest req, HttpServletResponse res){
|
||||
//System.out.println(Class.class.getClass().getResource("/").getPath());
|
||||
System.out.println(Configs.EXTRACT_LOG_LOCALTION);
|
||||
return new ModelMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.platform.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.platform.entities.GatherOracleInfo;
|
||||
|
||||
@Repository(value = "gatherOracleDao")
|
||||
public interface GatherOracleDao {
|
||||
|
||||
/**
|
||||
* @return 查询所有的oracle记录
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
public List<GatherOracleInfo> selectAllOracle() throws Exception;
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int deleteOracleById(int id) throws Exception;
|
||||
|
||||
/**
|
||||
* @param oracle
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int insertOracle(GatherOracleInfo oracle) throws Exception;
|
||||
|
||||
/**
|
||||
* @param oracle
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int updateOracleById(GatherOracleInfo oracle) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.platform.entities;
|
||||
|
||||
public class DataInfoEntityMoveTmp extends DataInfoEntity {
|
||||
|
||||
private String dstPath;
|
||||
|
||||
private String completeStatus;
|
||||
|
||||
private int rate;
|
||||
|
||||
private String lastTime; // 采集时间
|
||||
|
||||
public DataInfoEntityMoveTmp() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dstPath
|
||||
*/
|
||||
public String getDstPath() {
|
||||
return dstPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dstPath the dstPath to set
|
||||
*/
|
||||
public void setDstPath(String dstPath) {
|
||||
this.dstPath = dstPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the completeStatus
|
||||
*/
|
||||
public String getCompleteStatus() {
|
||||
return completeStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param completeStatus the completeStatus to set
|
||||
*/
|
||||
public void setCompleteStatus(String completeStatus) {
|
||||
this.completeStatus = completeStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the rate
|
||||
*/
|
||||
public int getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rate the rate to set
|
||||
*/
|
||||
public void setRate(int rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the lastTime
|
||||
*/
|
||||
public String getLastTime() {
|
||||
return lastTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lastTime the lastTime to set
|
||||
*/
|
||||
public void setLastTime(String lastTime) {
|
||||
this.lastTime = lastTime;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.platform.entities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FolderNode {
|
||||
private String name;
|
||||
private int isFolder; // 1 is file and other integer is folder show children number
|
||||
private String path;
|
||||
private List<FolderNode> childNodes = new ArrayList<FolderNode>();
|
||||
|
||||
|
||||
public FolderNode() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
public FolderNode(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public FolderNode(String name, int isFolder) {
|
||||
this.name = name;
|
||||
this.isFolder = isFolder;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the isFolder
|
||||
*/
|
||||
public int getIsFolder() {
|
||||
return isFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isFolder the isFolder to set
|
||||
*/
|
||||
public void setIsFolder(int isFolder) {
|
||||
this.isFolder = isFolder;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public List<FolderNode> getChildNodes() {
|
||||
return childNodes;
|
||||
}
|
||||
|
||||
public void setChildNodes(List<FolderNode> childNodes) {
|
||||
this.childNodes = childNodes;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.platform.entities;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import com.platform.utils.ConfigPropertyReader;
|
||||
import com.platform.utils.Configs;
|
||||
|
||||
public class OracleConnectorParams {
|
||||
private String port;
|
||||
private String ip;
|
||||
private String name;
|
||||
private String user;
|
||||
private String password;
|
||||
private String databaseName;
|
||||
|
||||
public OracleConnectorParams() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public OracleConnectorParams(String port, String ip, String name) {
|
||||
maybeInit();
|
||||
this.port = port;
|
||||
this.ip = ip;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public OracleConnectorParams(String port, String ip, String name,
|
||||
String user, String password, String database) {
|
||||
this.port = port;
|
||||
this.ip = ip;
|
||||
this.name = name;
|
||||
this.user = user;
|
||||
this.password = password;
|
||||
this.databaseName = database;
|
||||
}
|
||||
|
||||
private void maybeInit() {
|
||||
Properties properties = ConfigPropertyReader.Builder(
|
||||
Configs.CONFIG_LOCALTION).getProperties();
|
||||
this.user = properties.getProperty("collect-user");
|
||||
this.password = properties.getProperty("collect-password");
|
||||
this.databaseName = properties.getProperty("collect-database");
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getDatabaseName() {
|
||||
return databaseName;
|
||||
}
|
||||
|
||||
public void setDatabaseName(String databaseName) {
|
||||
this.databaseName = databaseName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.platform.entities;
|
||||
|
||||
public class SimpleConfigParamsBean {
|
||||
private String masterUrl;
|
||||
|
||||
private String oracleUserName;
|
||||
|
||||
private String oraclePassword;
|
||||
|
||||
private String oracleDBName;
|
||||
|
||||
public String getMasterUrl() {
|
||||
return masterUrl;
|
||||
}
|
||||
|
||||
public void setMasterUrl(String masterUrl) {
|
||||
this.masterUrl = masterUrl;
|
||||
}
|
||||
|
||||
public String getOracleUserName() {
|
||||
return oracleUserName;
|
||||
}
|
||||
|
||||
public void setOracleUserName(String oracleUserName) {
|
||||
this.oracleUserName = oracleUserName;
|
||||
}
|
||||
|
||||
public String getOraclePassword() {
|
||||
return oraclePassword;
|
||||
}
|
||||
|
||||
public void setOraclePassword(String oraclePassword) {
|
||||
this.oraclePassword = oraclePassword;
|
||||
}
|
||||
|
||||
public String getOracleDBName() {
|
||||
return oracleDBName;
|
||||
}
|
||||
|
||||
public void setOracleDBName(String oracleDBName) {
|
||||
this.oracleDBName = oracleDBName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.platform.glusterfs;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.platform.utils.Constant;
|
||||
|
||||
|
||||
|
||||
public class RemoveData {
|
||||
|
||||
public static Logger log = Logger.getLogger ( RemoveData.class);
|
||||
|
||||
|
||||
/**
|
||||
* -1 :error; 0: the filename is not exists ; 1: right
|
||||
* @param folderName
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public int deleteFolder(String folderName){
|
||||
log.info("start delete "+folderName);
|
||||
|
||||
ShowData showData=new ShowData();
|
||||
Map<String,String> reStrings=showData.showFolderData(folderName);
|
||||
|
||||
if(reStrings==null){
|
||||
log.error("3301 "+folderName+" is not exists");
|
||||
return -1;
|
||||
}
|
||||
|
||||
String command="rm -r "+folderName;
|
||||
|
||||
// int status=runCommand.runCommand(command);
|
||||
Constant.ganymedSSH.execCmdNoWaitAcquiescent(command);
|
||||
|
||||
log.info("delete "+folderName+" running");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testDeleteFolderFiles() {
|
||||
PropertyConfigurator.configure("log4j.properties");
|
||||
deleteFolder("/home/ubuntu");
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue