代码量有点大,耐心仔细看
public void getRptMerAccTotalListExcel() {
String username = "";
String organcode = "";
RptMeracctotal meracctotal = new RptMeracctotal();
List<RptMeracctotal> meracctotalList = rptMeracctotalDao.queryAll(meracctotal);
ArrayList<RptMerAccTotalListExcelVo> voArrayList = new ArrayList<>();
Long intotalcountTotal =0L;
Double intotalamtTotal = 0D;
Long outtotalcountTotal = 0L;
Double outtotalamtTotal = 0D;
for (RptMeracctotal rptMeracctotal : meracctotalList) {
RptMerAccTotalListExcelVo vo = new RptMerAccTotalListExcelVo();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Date rptdate = rptMeracctotal.getRptdate();
if (rptdate != null){
String dateString = formatter.format(rptdate);
vo.setRptdate(dateString);
}
Long intotalcount = rptMeracctotal.getIntotalcount() == null ? 0 : rptMeracctotal.getIntotalcount();
intotalcountTotal += intotalcount;
vo.setIntotalcount(intotalcount);
Double intotalamt = rptMeracctotal.getIntotalamt() == null ? 0.00 : rptMeracctotal.getIntotalamt().doubleValue()/100;
intotalamtTotal += intotalamt;
vo.setIntotalamt(intotalamt