Label labelColumn11 = new Label(11, 2, "本次出货量", formatColumnHeader);
Label labelColumn12 = new Label(12, 2, "累计出货量", formatColumnHeader);
sheet.addCell(labelColumn0);
sheet.addCell(labelColumn1);
sheet.addCell(labelColumn2);
sheet.addCell(labelColumn3);
sheet.addCell(labelColumn4);
sheet.addCell(labelColumn5);
sheet.addCell(labelColumn6);
sheet.addCell(labelColumn7);
sheet.addCell(labelColumn8);
sheet.addCell(labelColumn9);
sheet.addCell(labelColumn10);
sheet.addCell(labelColumn11);
sheet.addCell(labelColumn12);
// 内容格式设置
WritableFont fontContentHeader = new WritableFont(WritableFont.ARIAL, 10, WritableFont.NO_BOLD);
WritableCellFormat formatContentHeader = new WritableCellFormat();
formatContentHeader.setFont(fontContentHeader);
formatContentHeader.setAlignment(jxl.format.Alignment.CENTRE);
formatContentHeader.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
// 遍历输出list
int totalAboveRow = 3;// 上部高度
float totalsum = 0;
List
Label itemName = new Label(0, totalAboveRow, obj.getRequestBranchName(), formatContentHeader);//客户信息
sheet.addCell(itemName);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Label date = new Label(1, totalAboveRow, sdf.format(obj.getSalesDate()), formatContentHeader);//开单时间
sheet.addCell(date);
Label address = new Label(2, totalAboveRow, "", formatContentHeader);// 送货地址
sheet.addCell(address);
Label bomLable9 = null;
Label bomLable11 = null;
BdSecondaryUnit secoUnit =null;
for (int i = 0; i < list.size(); i++) {
Double price =0.0;
String priceStr ="";
String orderNumber ="";
String auditNumber ="";
String oweNumber ="";
String saleNumber ="";
//累计出货
String totalGoOutStr ="";
if(list.get(i)[9]!=null){
secoUnit = (BdSecondaryUnit) this.getQcyOweOrderDAO().getObject("from BdSecondaryUnit where product.id=" +list.get(i)[9]);
}
if (null != list.get(i)[4] && null != list.get(i)[10]&& null != list.get(i)[6]) {
price = Double.parseDouble(list.get(i)[4].toString())/Double.parseDouble(list.get(i)[10].toString())*Double.parseDouble( list.get(i)[6].toString()) ;
priceStr = Tool.keep4DecimalRounding1ToString(price);
}
totalsum += price;
//订货量
if (null != list.get(i)[3]&&null != list.get(i)[10]&& Double.parseDouble(list.get(i)[3].toString())>=Double.parseDouble(list.get(i)[10].toString())) {
orderNumber= (int) (Double.parseDouble(list.get(i)[3].toString())/Double.parseDouble( list.get(i)[10].toString()))+ list.get(i)[2].toString();
}
if (null != list.get(i)[3]&&null != list.get(i)[10]&& null != secoUnit&&secoUnit.getSecondary2Basic()!=null &&
Double.parseDouble(list.get(i)[3].toString()) % Double.parseDouble(list.get(i)[10].toString()) != 0) {
orderNumbe