| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | List<OrderSupplierReportResultVO> list = orderReportMapper.getOrderSupplierReport(supplierReportCalendarBO); |
| | | |
| | | String[] rowsName = new String[]{"序号","日期", "供应商ID", "供应商","花农底价" |
| | | , "降级扣款", "缺货扣款(缺货+补货)","售后扣花农款","售后扣合伙人款","实际销售扎数","结算费用","订单状态"}; |
| | | , "降级扣款", "缺货扣款(缺货+补货)","售后扣花农款","实际销售扎数","结算费用","订单状态"}; |
| | | List<Object[]> dataList = new ArrayList<>(); |
| | | int sn = 1; |
| | | for (OrderSupplierReportResultVO o : list) { |
| | | Object[] objs = new Object[rowsName.length]; |
| | | int a = 0; |
| | | objs[a++] = sn; // 序号 |
| | | objs[a++] = format(o.getOrderDate(), "yyyy-MM-dd"); // 日期 |
| | | objs[a++] = o.getSupplierId(); // 供应商ID |
| | | objs[a++] = o.getSupplierName(); // 供应商 |
| | | objs[a++] = o.getOrderSupplierPriceAmount(); // 花农底价 |
| | | objs[a++] = o.getOrderCheckFee(); //降级扣款 |
| | | objs[a++] = o.getOrderLackFeeSupplier();//缺货扣款 |
| | | objs[a++] = o.getSalesFeeSupplier(); // 售后扣花农款 |
| | | objs[a++] = o.getRealSaleNum(); // 实际销售扎数 |
| | | objs[a++] = o.getProfitFeeAmount(); // 结算费用 |
| | | objs[a++] = o.getSettleStatus(); // 订单状态 |
| | | dataList.add(objs); |
| | | sn++; |
| | | if(!ObjectUtils.isEmpty(o)) { |
| | | Object[] objs = new Object[rowsName.length]; |
| | | int a = 0; |
| | | objs[a++] = sn; // 序号 |
| | | objs[a++] = format(o.getDateinfo(), "yyyy-MM-dd"); // 日期 |
| | | objs[a++] = o.getSupplierId(); // 供应商ID |
| | | objs[a++] = o.getSupplierName(); // 供应商 |
| | | objs[a++] = o.getOrderSupplierPriceAmount(); // 花农底价 |
| | | objs[a++] = o.getOrderCheckFee(); //降级扣款 |
| | | objs[a++] = o.getOrderLackFeeSupplier();//缺货扣款 |
| | | objs[a++] = o.getSalesFeeSupplier(); // 售后扣花农款 |
| | | objs[a++] = o.getRealSaleNum(); // 实际销售扎数 |
| | | objs[a++] = o.getProfitFeeAmount(); // 结算费用 |
| | | objs[a++] = o.getSettleStatus(); // 订单状态 |
| | | dataList.add(objs); |
| | | sn++; |
| | | } |
| | | } |
| | | |
| | | ExcelExportUtil excelExportUtil = new ExcelExportUtil("花农结算报表", rowsName, dataList, response); |