Commit be1d3a7b authored by Administrator's avatar Administrator

2018年3月13日 --智能分析平台

--R文件修改路径
parent c35ea6f8
......@@ -158,8 +158,19 @@ public class RegularityAnalysisController {
System.out.println("!!!!!bacTypeList:"+bacTypeList.size());
System.out.println("!!!!!providerList:"+providerList.size());
System.out.println("!!!!!analysisTypeList:"+analysisTypeList.size());
ArrayList<Double> business = new ArrayList<Double>();//所有业务
for(int t = 0;t < busList.size();t++){
if("Y".equals(busList.get(t).getIsActive())){
business.add(Double.parseDouble(String.valueOf(busList.get(t).getBusinessId())));
}
}
double [] Dbusiness = new double[business.size()];
for (int i = 0; i < business.size(); i++) {
Dbusiness[i] = business.get(i);
}
System.out.println("!!!!businessList:"+Arrays.toString(business.toArray()));
// 调用R生成图片
String imageName = request.getSession().getId()+ System.currentTimeMillis() + ".jpeg";
......@@ -178,7 +189,8 @@ public class RegularityAnalysisController {
/* driverPath = "C:\\vertica-jdbc-7.0.1.jar";*/
s.eval("library('YWGL')");
// s.eval("library('YWGL')");
s.eval("source('/home/R/YWGL/R/text.R')");
s.set("analysisType", 1);//同省同渠道多业务
double[] province = { 26 };//贵州
s.set("province", province);
......@@ -188,13 +200,14 @@ public class RegularityAnalysisController {
double[] channel = { 4 };//实体厅
s.set("channel", channel);
double[] business = new double[busList.size()];//所有业务
for(int t = 0;t < busList.size();t++){
business[t] = Double.parseDouble(String.valueOf(busList.get(t).getBusinessId()));
}
// double[] business = new double[busList.size()];//所有业务
// for(int t = 0;t < busList.size();t++){
// business[t] = Double.parseDouble(String.valueOf(busList.get(t).getBusinessId()));
// }
System.out.println(Arrays.toString(business));
s.set("business", business);
s.set("business", Dbusiness);
s.set("kpiType", 1);
s.set("granularity", -1);
s.set("kpi", -1);
......@@ -230,7 +243,10 @@ public class RegularityAnalysisController {
s.set("imagePath", imagePath);
s.set("driverPath", driverPath);
REXP rexp = s.eval("ywgl(analysisType,province,city,bacType,datasource,channel,business,kpiType,kpi,link,granularity,start,end,dbHost,dbPort,dbName,dbUser,dbPassword,imagePath,driverPath)");
REXP rexp = s.eval("ywgl(analysisType,province,city,bacType,datasource,channel," +
"business,kpiType,kpi,link,granularity,start,end,dbHost,dbPort,dbName,dbUser,dbPassword," +
"imagePath,driverPath)");
System.out.println("rexp:"+rexp);
RList rl = rexp.asList();
System.out.println("value:\n" + ((REXPString) rl.get("value")).asString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment