//接口实现
public List ExcelProdCustomer() throws Exception {
// TODO Auto-generated method stub
String hql = " select VPerDep,count(VPerDep) as countnum from TcWhPersionnel group by VPerDep";
//select V_PER_DEP,COUNT(V_PER_DEP) AS COUNTNUM from tc_wh_persionnel GROUP BY V_PER_DEP
List<jsontest> list = new ArrayList();
try {
list = (List<jsontest>)super.search(hql);
} catch (Exception e) {
e.printStackTrace();
}
return list;
}//ACTION类
public String DownExcel()throws Exception{
List<JsonExcelAll> josnExcelList =new ArrayList<JsonExcelAll>();
List<jsontest> listRawInventory = new ArrayList<jsontest>();
listRawInventory =persionnelService.ExcelProdCustomer();
if(listRawInventory !=null && listRawInventory.size()>0){
for(int i=0;i<listRawInventory.size();i++){//全部数据
try {
jsontest prodCustomer = listRawInventory.get(i); JsonExcelAll jsonexcel = new JsonExcelAll();
jsonexcel.setDef45(prodCustomer.getVPerDep());//客户名称
jsonexcel.setDef46(prodCustomer.getCountnum());//地址
josnExcelList.add(jsonexcel);
} catch (Exception e) {
// TODO: handle exception
System.out.println(e.toString());
}
}
}
downLoadExcelByReporBeanList("光学成品出库明细表.jasper", "材料进出库情况表", new HashMap(),josnExcelList);
return null;
}//jsontest
public class jsontest {
private String countnum; //自增ID
private String VPerDep; //编号 public String getVPerDep() {
return VPerDep;
}
public void setVPerDep(String perDep) {
VPerDep = perDep;
}
public String getCountnum() {
return countnum;
}
public void setCountnum(String countnum) {
this.countnum = countnum;
}
}
//
想要把SQL查询出来的统计数据写入JSON中,可是每次一执行到jsontest prodCustomer = listRawInventory.get(i);这句话就报错,不懂什么原因,望大侠指教,本人大菜鸟
public List ExcelProdCustomer() throws Exception {
// TODO Auto-generated method stub
String hql = " select VPerDep,count(VPerDep) as countnum from TcWhPersionnel group by VPerDep";
//select V_PER_DEP,COUNT(V_PER_DEP) AS COUNTNUM from tc_wh_persionnel GROUP BY V_PER_DEP
List<jsontest> list = new ArrayList();
try {
list = (List<jsontest>)super.search(hql);
} catch (Exception e) {
e.printStackTrace();
}
return list;
}//ACTION类
public String DownExcel()throws Exception{
List<JsonExcelAll> josnExcelList =new ArrayList<JsonExcelAll>();
List<jsontest> listRawInventory = new ArrayList<jsontest>();
listRawInventory =persionnelService.ExcelProdCustomer();
if(listRawInventory !=null && listRawInventory.size()>0){
for(int i=0;i<listRawInventory.size();i++){//全部数据
try {
jsontest prodCustomer = listRawInventory.get(i); JsonExcelAll jsonexcel = new JsonExcelAll();
jsonexcel.setDef45(prodCustomer.getVPerDep());//客户名称
jsonexcel.setDef46(prodCustomer.getCountnum());//地址
josnExcelList.add(jsonexcel);
} catch (Exception e) {
// TODO: handle exception
System.out.println(e.toString());
}
}
}
downLoadExcelByReporBeanList("光学成品出库明细表.jasper", "材料进出库情况表", new HashMap(),josnExcelList);
return null;
}//jsontest
public class jsontest {
private String countnum; //自增ID
private String VPerDep; //编号 public String getVPerDep() {
return VPerDep;
}
public void setVPerDep(String perDep) {
VPerDep = perDep;
}
public String getCountnum() {
return countnum;
}
public void setCountnum(String countnum) {
this.countnum = countnum;
}
}
//
想要把SQL查询出来的统计数据写入JSON中,可是每次一执行到jsontest prodCustomer = listRawInventory.get(i);这句话就报错,不懂什么原因,望大侠指教,本人大菜鸟
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货