Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
69 changes: 37 additions & 32 deletions echarts_mavenweb/.classpath
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="D:/majars/mobem_pub.jar"/>
<classpathentry kind="lib" path="D:/majars/log.jar"/>
<classpathentry kind="lib" path="C:/Users/wangzhaod/Desktop/登录jar/httpmime-4.1.3.jar"/>
<classpathentry kind="lib" path="C:/Users/wangzhaod/Desktop/登录jar/umcontrol.jar"/>
<classpathentry kind="lib" path="C:/Users/wangzhaod/Desktop/登录jar/umcore.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
89 changes: 47 additions & 42 deletions echarts_mavenweb/.project
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>echarts_mavenweb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>echarts_mavenweb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>de.loskutov.FileSync.FSBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
7 changes: 7 additions & 0 deletions echarts_mavenweb/.settings/de.loskutov.FileSync.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
WARNING=DO NOT MODIFY THIS FILE IF YOU DON'T UNDERSTAND
defaultDestination=D\:/AndroidDev/failurereporter/assets/www
defaultVariables=
eclipse.preferences.version=1
includeTeamPrivateFiles=false
map|0=src/main/webapp|,|,|META-INF/;WEB-INF/|,
useCurrentDateForDestinationFiles=false
4 changes: 4 additions & 0 deletions echarts_mavenweb/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/webapp/js/detailDatas_200.js=UTF-8
encoding//src/main/webapp/js/failure.detail.view.js=UTF-8
encoding//src/main/webapp/js/summaryDatas_200.js=UTF-8
6 changes: 3 additions & 3 deletions echarts_mavenweb/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.7
22 changes: 19 additions & 3 deletions echarts_mavenweb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,28 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.2.Final</version>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.1.0</version>
</dependency>

</dependencies>
<build>
<finalName>echarts_mavenweb</finalName>
Expand Down
1 change: 1 addition & 0 deletions echarts_mavenweb/src/main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/webapp.rar
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.echarts.controllers;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
import org.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.echarts.utils.MaConfig;
import com.echarts.utils.MaRequestBuilder;
import com.echarts.utils.ServiceMapperConfig;

@Controller
public class FailureDetailController {
private static final String BEGIN_TIME_OF_ONE_MONTH = "01 00:00:00";
private static final String LAST_TIME_OF_ONE_MONTH = "31 23:59:59";

@RequestMapping("/failureDetail.jsonp")
public JSONObject loadFailureDetail(
@RequestParam String user,
@RequestParam String password,
@RequestParam String groupId,
@RequestParam String userId,
@RequestParam String token,
@RequestParam String startMonth,
@RequestParam String endMonth,
@RequestParam String summaryType,
@RequestParam String id) throws Exception {

// ����
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("userid", userId);
parameters.put("groupid", groupId);
parameters.put("pk_org", id);
parameters.put("bmonth", beginTimeOf(startMonth));
parameters.put("emonth", lastTimeOf(endMonth));

String action = ServiceMapperConfig.mappedDetailService(summaryType);
MaRequestBuilder builder = new MaRequestBuilder();
builder.commonService()
.actionName(action)
.parameters(parameters)
.user(user)
.password(password)
.token(token)
.build();

HttpClient client = new HttpClient();
String url = MaConfig.getConfig().url;
PostMethod post = new PostMethod(url);
post.setQueryString(builder.getRequest());

int status = client.executeMethod(post);
if(status != HttpStatus.SC_OK){
return null;
}

String responseString = post.getResponseBodyAsString();
//responseString = new String(out.toByteArray(), "UTF-8");
System.out.println(responseString);
JSONObject responseJson = new JSONObject(responseString);
JSONObject datasJson = responseJson.getJSONObject("data").getJSONObject("resultctx");
return datasJson;
/* JSONArray failureTypeDetailsJson = datasJosn.getJSONArray("failureType");
JSONArray failureReasonDetailsJson = datasJosn.getJSONArray("failureReason");
JSONArray failureSymptomDetailsJson = datasJosn.getJSONArray("failureSymptom");

List<FailureSummary> summaries = new ArrayList<FailureSummary>();
for (int i = 0; i < summariesJson.length(); i++) {
JSONObject oneSummaryJson = summariesJson.getJSONObject(i);
FailureSummary oneSummary = new FailureSummary();
oneSummary.setId(oneSummaryJson.getString("id"));
oneSummary.setName(oneSummaryJson.getString("name"));
oneSummary.setHaltedTimes(oneSummaryJson.getString("haltedTimes"));
oneSummary.setHaltedHours(oneSummaryJson.getString("haltedHours"));
summaries.add(oneSummary);
}

return summaries;*/
}

private String beginTimeOf(String month) {
return month + "-" + BEGIN_TIME_OF_ONE_MONTH;
}

private String lastTimeOf(String month) {
return month + "-" + LAST_TIME_OF_ONE_MONTH;
}
}
Loading