|
@ -33,8 +33,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.yxt.supervise.portal.api.dictcommon.DictCommon; |
|
|
import com.yxt.supervise.portal.api.dictcommon.DictCommon; |
|
|
import com.yxt.supervise.portal.api.dictcommon.DictCommonDetailsVo; |
|
|
import com.yxt.supervise.portal.api.dictcommon.DictCommonDetailsVo; |
|
|
import com.yxt.supervise.portal.api.inventoryinformation.*; |
|
|
import com.yxt.supervise.portal.api.inventoryinformation.*; |
|
|
|
|
|
import com.yxt.supervise.portal.api.productnum.ProductNum; |
|
|
import com.yxt.supervise.portal.api.purchaserequisitionpro.PurchaseRequisitionPro; |
|
|
import com.yxt.supervise.portal.api.purchaserequisitionpro.PurchaseRequisitionPro; |
|
|
import com.yxt.supervise.portal.biz.dictcommon.DictCommonService; |
|
|
import com.yxt.supervise.portal.biz.dictcommon.DictCommonService; |
|
|
|
|
|
import com.yxt.supervise.portal.biz.productnum.ProductNumService; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
@ -301,15 +303,18 @@ public class InventoryInformationService extends MybatisBaseService<InventoryInf |
|
|
System.out.println(x1); |
|
|
System.out.println(x1); |
|
|
//return message;
|
|
|
//return message;
|
|
|
} |
|
|
} |
|
|
|
|
|
@Resource |
|
|
|
|
|
private ProductNumService productNumService; |
|
|
public HSSFWorkbook exportExcel( HSSFWorkbook wb) { |
|
|
public HSSFWorkbook exportExcel( HSSFWorkbook wb) { |
|
|
String title = "采购订单商品明细表"; |
|
|
String title = "重点品类商品订货明细"; |
|
|
String[] col = {"审核单号","状态","合计金额"}; |
|
|
String[] col = {"审核单号","状态","合计金额"}; |
|
|
String[] col1 = {"序号","商品代码","商品名称","规格型号","数量","单位","单价(元)","含税单价(元)","合计(元)", |
|
|
String[] col1 = {"序号","厂商编码","厂商名称","商品代码","商品条码","商品名称","单位","进价","配价","售价","箱规", |
|
|
"包内数量","包装规格","包代码","包数量","包单价","包合计","商品品类","品牌名称","发货日期"}; |
|
|
"订货数量","订货金额(元)","合计","税票","降价折扣%","判定结果","备注"}; |
|
|
//sheet名
|
|
|
//sheet名
|
|
|
String sheetName = "采购订单商品明细表"; |
|
|
String sheetName = "重点品类商品订货明细"; |
|
|
//创建HSSFWorkbook
|
|
|
//创建HSSFWorkbook
|
|
|
String [][]content={{"张三","男","12","清华大学","大一"},{"李四","女","14","北京大学","大二"}}; |
|
|
//String [][]content={{"张三","男","12","清华大学","大一"},{"李四","女","14","北京大学","大二"}};
|
|
|
|
|
|
List<ProductNum> productNums=productNumService.getAll(); |
|
|
// 第一步,创建一个HSSFWorkbook,对应一个Excel文件
|
|
|
// 第一步,创建一个HSSFWorkbook,对应一个Excel文件
|
|
|
if(wb == null){ |
|
|
if(wb == null){ |
|
|
wb = new HSSFWorkbook(); |
|
|
wb = new HSSFWorkbook(); |
|
@ -329,29 +334,48 @@ public class InventoryInformationService extends MybatisBaseService<InventoryInf |
|
|
titleRow.setCellValue(title); |
|
|
titleRow.setCellValue(title); |
|
|
titleRow.setCellStyle(style); |
|
|
titleRow.setCellStyle(style); |
|
|
|
|
|
|
|
|
HSSFCell titleRow1 = row.createCell(1); |
|
|
/*HSSFCell titleRow1 = row.createCell(1); |
|
|
titleRow1.setCellValue("审核单号:123456789 状态:已通过审核 合计金额:12345678"); |
|
|
titleRow1.setCellValue("审核单号:123456789 状态:已通过审核 合计金额:12345678"); |
|
|
titleRow1.setCellStyle(style); |
|
|
titleRow1.setCellStyle(style);*/ |
|
|
|
|
|
|
|
|
//声明列对象
|
|
|
//声明列对象
|
|
|
|
|
|
|
|
|
HSSFCell cell = null; |
|
|
HSSFCell cell = null; |
|
|
|
|
|
|
|
|
//创建标题
|
|
|
//创建标题
|
|
|
HSSFRow row1 = sheet.createRow(2); |
|
|
HSSFRow row1 = sheet.createRow(1); |
|
|
for(int i=0;i<col.length;i++){ |
|
|
for(int i=0;i<col1.length;i++){ |
|
|
cell = row1.createCell(i); |
|
|
cell = row1.createCell(i); |
|
|
cell.setCellValue(col[i]); |
|
|
cell.setCellValue(col1[i]); |
|
|
cell.setCellStyle(style); |
|
|
cell.setCellStyle(style); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//创建内容
|
|
|
//创建内容
|
|
|
for(int i=0;i<content.length;i++){ |
|
|
for(int i=0;i<productNums.size();i++){ |
|
|
row = sheet.createRow(i + 2); |
|
|
row = sheet.createRow(i + 2); |
|
|
for(int j=0;j<content[i].length;j++){ |
|
|
|
|
|
//将内容按顺序赋给对应的列对象
|
|
|
//将内容按顺序赋给对应的列对象
|
|
|
row.createCell(j).setCellValue(content[i][j]); |
|
|
//"序号","厂商编码","厂商名称","商品代码","商品条码","商品名称","单位","进价","售价","箱规","订货数量","订货金额(元)","合计","税票","降价折扣%"
|
|
|
} |
|
|
|
|
|
|
|
|
row.createCell(0).setCellValue(i); |
|
|
|
|
|
row.createCell(1).setCellValue(productNums.get(i).getSupplierCode()); |
|
|
|
|
|
row.createCell(2).setCellValue(productNums.get(i).getSupplierName()); |
|
|
|
|
|
row.createCell(3).setCellValue(productNums.get(i).getCode()); |
|
|
|
|
|
row.createCell(4).setCellValue(productNums.get(i).getBarCode()); |
|
|
|
|
|
row.createCell(5).setCellValue(productNums.get(i).getName()); |
|
|
|
|
|
row.createCell(6).setCellValue(productNums.get(i).getUnit()); |
|
|
|
|
|
row.createCell(7).setCellValue(productNums.get(i).getPurchasePrice());//进价
|
|
|
|
|
|
row.createCell(8).setCellValue(productNums.get(i).getValence());//进价
|
|
|
|
|
|
row.createCell(9).setCellValue(productNums.get(i).getPrice());//售价
|
|
|
|
|
|
row.createCell(10).setCellValue(productNums.get(i).getBoxGauge()); |
|
|
|
|
|
row.createCell(11).setCellValue(productNums.get(i).getNum()); |
|
|
|
|
|
row.createCell(12).setCellValue(productNums.get(i).getOrderAmount()); |
|
|
|
|
|
row.createCell(13).setCellValue("0"); |
|
|
|
|
|
row.createCell(14).setCellValue(productNums.get(i).getTaxReceipt()); |
|
|
|
|
|
row.createCell(15).setCellValue(productNums.get(i).getDiscount()); |
|
|
|
|
|
row.createCell(16).setCellValue(productNums.get(i).getState()); |
|
|
|
|
|
row.createCell(17).setCellValue(productNums.get(i).getRemarks()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return wb; |
|
|
return wb; |
|
|
} |
|
|
} |
|
|