List<CurrentlyOutstandingAgingInfo> listR=new ArrayList<CurrentlyOutstandingAgingInfo>();
for(int j=0;j<str.length;j++){
CurrentlyOutstandingAgingInfo cc=new CurrentlyOutstandingAgingInfo();
String customerId=str[j].toString();
Double current=0.0;//当前
for(int i=0;i<djralist.size();i++){Double docTotal=0.0;//单据-总金额
String docDate="";//单据日期
Double docCurrent=0.0;//单据-当前
if(djralist.get(1)[2].toString().equals(customerId)){
CurrentlyOutstandingAgingInfo coaiRv=new CurrentlyOutstandingAgingInfo();//创建实例
long js=sdf.parse(djralist.get(i)[7].toString()).getTime()/1000/60/60/24;//结算long
docDate=djralist.get(i)[4].toString();//单据日期
//查询单个的单据信息
if(js-lygz<0&&js-lyyear>0){
if(jz-js<0&&js-lygz>0){//当前
docCurrent+=Double.parseDouble(djralist.get(i)[24].toString());
}
coaiRv.setCustomerId(customerId);
coaiRv.setDocCurrent(docCurrent);
listR.add(coaiRv);
lastYear+=docLy;
current+=docCurrent;
}
}
for(int i=0;i<djrvlist.size();i++){
String docDate="";//单据日期
Double docCurrent=0.0;//单据-当前
if(djrvlist.get(i)[2].toString().equals(customerId)){
CurrentlyOutstandingAgingInfo coaiRv=new CurrentlyOutstandingAgingInfo();//创建实例
long js=sdf.parse(djrvlist.get(i)[6].toString()).getTime()/1000/60/60/24;//结算long
//查询单个的单据信息
String hql1="from AccountDetail where settlementNo = '"+djrvlist.get(i)[22]+"'";//获得复核状态信息
AccountDetail ad = adDao.get(hql1);
if(ad!=null){
long fh=sdf.parse(ad.getFuheDate().toString()).getTime();//复核日期long
if(ad.getStatus()==2){//已复核
if(fh-jz>0){//复核日期>截止日期 则统计
if(jz-js<0&&js-lygz>0){//当前
docCurrent+=Double.parseDouble(djrvlist.get(i)[21].toString());
}
}
}
}
coaiRv.setDocCurrent(docCurrent);
listR.add(coaiRv);
current+=docCurrent;
}
}
cc.setCurrent(current);
cc.setCustomerId(customerId);
listR.add(cc);
}
间单代码如上 current和doccurrent 到后面都有值 添加到listR集合后集合里CC为null 求指教!!
------解决思路----------------------
debug 调试看看。null 是很常见的错误。
------解决思路----------------------
debug为上策,大家没心思仔细看你的代码的。
------解决思路----------------------
你这贴的代码没有办法看呀
------解决思路----------------------
代码很乱啊..........
------解决思路----------------------
楼主赐你3个字 debug

------解决思路----------------------
看花。好乱写的。