@RequestMapping("/getListByIdAndYear1")
@ResponseBody
public Object getListByIdAndYear1(@RequestBody InvestVo investVo) {
if (ToolUtil.isEmpty(investVo)){
return null;
}
if (investVo.getInvestYear() == null){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
Date date = new Date();
String investYear = sdf.format(date);
System.out.println("今年是:"+investYear);
investVo.setInvestYear(investYear);
}
List yearInvestVoList = null;
List total = new ArrayList();
List projectList = investVo.getProjectId();
System.out.println(projectList);
String arr[]=new String[12]; //计划投资数组
String arr1[]=new String[12]; //计划投资数组
yearInvestVoList = yearInvestService.getListByIdAndYear(projectList,investVo.getInvestYear());
System.out.println(yearInvestVoList);
if(yearInvestVoList.get(0) != null && !yearInvestVoList.isEmpty() && yearInvestVoList.size()>0){
arr[0] = yearInvestVoList.get(0).getPlanJanuary().toString();
arr[1] = yearInvestVoList.get(0).getPlanFebruary().toString();
arr[2] = yearInvestVoList.get(0).getPlanMarch().toString();
arr[3] = yearInvestVoList.get(0).getPlanApril().toString();
arr[4] = yearInvestVoList.get(0).getPlanMay().toString();
arr[5] = yearInvestVoList.get(0).getPlanJune().toString();
arr[6] = yearInvestVoList.get(0).getPlanJuly().toString();
arr[7] = yearInvestVoList.get(0).getPlanAugust().toString();
arr[8] = yearInvestVoList.get(0).getPlanSeptember().toString();
arr[9] = yearInvestVoList.get(0).getPlanOctober().toString();
arr[10] = yearInvestVoList.get(0).getPlanNovember().toString();
arr[11] = yearInvestVoList.get(0).getPlanDecember().toString();
arr1[0] = yearInvestVoList.get(0).getRealJanuary().toString();
arr1[1] = yearInvestVoList.get(0).getRealFebruary().toString();
arr1[2] = yearInvestVoList.get(0).getRealMarch().toString();
arr1[3] = yearInvestVoList.get(0).getRealApril().toString();
arr1[4] = yearInvestVoList.get(0).getRealMay().toString();
arr1[5] = yearInvestVoList.get(0).getRealJune().toString();
arr1[6] = yearInvestVoList.get(0).getRealJuly().toString();
arr1[7] = yearInvestVoList.get(0).getRealAugust().toString();
arr1[8] = yearInvestVoList.get(0).getRealSeptember().toString();
arr1[9] = yearInvestVoList.get(0).getRealOctober().toString();
arr1[10] = yearInvestVoList.get(0).getRealNovember().toString();
arr1[11] = yearInvestVoList.get(0).getRealDecember().toString();
}
List plan = Arrays.asList(arr);
System.out.println("计划投资数据:"+plan);
List real = Arrays.asList(arr1);
System.out.println("实际投资数据:"+real);
List yearList ;
List plist = new ArrayList<>();
List oneProject = new ArrayList<>();
String condition = null;
for (int i = 0;i
ProjectInfoVo projectInfoVo = projectInfoService.getProListById1(condition, Integer.parseInt(projectList.get(i).toString().trim()));
oneProject.add(projectList.get(i));
System.out.println(oneProject);
yearList = yearInvestService.getListByIdAndYear(oneProject,investVo.getInvestYear());
System.out.println("投资信息:"+yearList);
if(yearList.size()==1&&null==yearList.get(0)||yearList.size()==0){
}else{
projectInfoVo.setInvestTotal(yearList.get(0).getPlanYearTotal());
plist.add(projectInfoVo);
}
}
System.out.println("投资信息:"+plist);
JSONArray array= JSONArray.fromObject(yearInvestVoList.get(0));
System.out.println(array);
Map map = new HashMap();
map.put("result",200);
map.put("plist",plist);
map.put("plan",plan);
map.put("real",real);
map.put("item",yearInvestVoList);
return map;
}
@RequestMapping("/getListByIdAndYear1")
@ResponseBody
public Object getListByIdAndYear1(@RequestBody InvestVo investVo) {
if (ToolUtil.isEmpty(investVo)){
return null;
}
if (investVo.getInvestYear() == null){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
Date date = new Date();
String investYear = sdf.format(date);
System.out.println("今年是:"+investYear);
investVo.setInvestYear(investYear);
}
List yearInvestVoList = null;
List total = new ArrayList();
List projectList = investVo.getProjectId();
System.out.println(projectList);
String arr[]=new String[12]; //计划投资数组
String arr1[]=new String[12]; //计划投资数组
yearInvestVoList = yearInvestService.getListByIdAndYear(projectList,investVo.getInvestYear());
System.out.println(yearInvestVoList);
if(yearInvestVoList.get(0) != null && !yearInvestVoList.isEmpty() && yearInvestVoList.size()>0){
arr[0] = yearInvestVoList.get(0).getPlanJanuary().toString();
arr[1] = yearInvestVoList.get(0).getPlanFebruary().toString();
arr[2] = yearInvestVoList.get(0).getPlanMarch().toString();
arr[3] = yearInvestVoList.get(0).getPlanApril().toString();
arr[4] = yearInvestVoList.get(0).getPlanMay().toString();
arr[5] = yearInvestVoList.get(0).getPlanJune().toString();
arr[6] = yearInvestVoList.get(0).getPlanJuly().toString();
arr[7] = yearInvestVoList.get(0).getPlanAugust().toString();
arr[8] = yearInvestVoList.get(0).getPlanSeptember().toString();
arr[9] = yearInvestVoList.get(0).getPlanOctober().toString();
arr[10] = yearInvestVoList.get(0).getPlanNovember().toString();
arr[11] = yearInvestVoList.get(0).getPlanDecember().toString();
arr1[0] = yearInvestVoList.get(0).getRealJanuary().toString();
arr1[1] = yearInvestVoList.get(0).getRealFebruary().toString();
arr1[2] = yearInvestVoList.get(0).getRealMarch().toString();
arr1[3] = yearInvestVoList.get(0).getRealApril().toString();
arr1[4] = yearInvestVoList.get(0).getRealMay().toString();
arr1[5] = yearInvestVoList.get(0).getRealJune().toString();
arr1[6] = yearInvestVoList.get(0).getRealJuly().toString();
arr1[7] = yearInvestVoList.get(0).getRealAugust().toString();
arr1[8] = yearInvestVoList.get(0).getRealSeptember().toString();
arr1[9] = yearInvestVoList.get(0).getRealOctober().toString();
arr1[10] = yearInvestVoList.get(0).getRealNovember().toString();
arr1[11] = yearInvestVoList.get(0).getRealDecember().toString();
}
List plan = Arrays.asList(arr);
System.out.println("计划投资数据:"+plan);
List real = Arrays.asList(arr1);
System.out.println("实际投资数据:"+real);
List yearList ;
List plist = new ArrayList<>();
List oneProject = new ArrayList<>();
String condition = null;
for (int i = 0;i
ProjectInfoVo projectInfoVo = projectInfoService.getProListById1(condition, Integer.parseInt(projectList.get(i).toString().trim()));
oneProject.add(projectList.get(i));
System.out.println(oneProject);
yearList = yearInvestService.getListByIdAndYear(oneProject,investVo.getInvestYear());
System.out.println("投资信息:"+yearList);
if(yearList.size()==1&&null==yearList.get(0)||yearList.size()==0){
}else{
projectInfoVo.setInvestTotal(yearList.get(0).getPlanYearTotal());
plist.add(projectInfoVo);
}
}
System.out.println("投资信息:"+plist);
JSONArray array= JSONArray.fromObject(yearInvestVoList.get(0));
System.out.println(array);
Map map = new HashMap();
map.put("result",200);
map.put("plist",plist);
map.put("plan",plan);
map.put("real",real);
map.put("item",yearInvestVoList);
return map;
}