|
@@ -181,10 +181,45 @@ public class ProductInvoiceServiceImpl implements IProductInvoiceService
|
|
|
}else {
|
|
|
//表格数据
|
|
|
//根据销售单编号查询货品信息
|
|
|
- List<ProductInvoiceVO.SaleProductInfo> saleProductInfoList = saleProductsMapper.selectSaleProductsInfo(saleOrderNo);
|
|
|
+// List<ProductInvoiceVO.SaleProductInfo> saleProductInfoList = saleProductsMapper.selectSaleProductsInfo(saleOrderNo);
|
|
|
+ List<ProductInvoiceVO.SaleProductInfo> saleProductInfoList = saleProductsMapper.selectSaleProductsInfo1(saleOrderNo);
|
|
|
+
|
|
|
+ for (ProductInvoiceVO.SaleProductInfo saleProductInfo : saleProductInfoList){
|
|
|
+ //查询库存信息
|
|
|
+ if(saleProductInfo.getLotNum() != null){
|
|
|
+ ProductInventory productInventory1 = new ProductInventory();
|
|
|
+ productInventory1.setProductId(saleProductInfo.getProductId());
|
|
|
+ productInventory1.setLotNum(saleProductInfo.getLotNum());
|
|
|
+ productInventory1.setProductColour(saleProductInfo.getProductColor());
|
|
|
+
|
|
|
+ ProductInventory productInventory = productInventoryMapper.selectProductInventoryInfo(productInventory1);
|
|
|
+
|
|
|
+ if(productInventory != null){
|
|
|
+ saleProductInfo.setLevels(productInventory.getLevels());
|
|
|
+ saleProductInfo.setQrCode(productInventory.getQrCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(productInvoice != null){
|
|
|
for (ProductInvoiceVO.SaleProductInfo saleProductInfo : saleProductInfoList){
|
|
|
|
|
|
+ //查询库存信息
|
|
|
+// if(saleProductInfo.getLotNum() != null){
|
|
|
+// ProductInventory productInventory1 = new ProductInventory();
|
|
|
+// productInventory1.setProductId(saleProductInfo.getProductId());
|
|
|
+// productInventory1.setLotNum(saleProductInfo.getLotNum());
|
|
|
+// productInventory1.setProductColour(saleProductInfo.getProductColor());
|
|
|
+//
|
|
|
+// ProductInventory productInventory = productInventoryMapper.selectProductInventoryInfo(productInventory1);
|
|
|
+//
|
|
|
+// if(productInventory != null){
|
|
|
+// saleProductInfo.setLevels(productInventory.getLevels());
|
|
|
+// saleProductInfo.setQrCode(productInventory.getQrCode());
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
//获取已出库箱数和重量
|
|
|
ProductOutboundRecord productOutboundRecord = productOutboundRecordMapper
|
|
|
.statisticsBoxNumSuttle1(saleProductInfo.getProductId(), productInvoice.getNoticeNumber(),saleProductInfo.getProductColor());
|
|
@@ -204,18 +239,24 @@ public class ProductInvoiceServiceImpl implements IProductInvoiceService
|
|
|
}
|
|
|
}
|
|
|
//查询当前批号库存箱数,重量
|
|
|
- ProductInventory productInventory1 = new ProductInventory();
|
|
|
- productInventory1.setProductId(saleProductInfoList.get(0).getProductId());
|
|
|
- productInventory1.setLotNum(saleProductInfoList.get(0).getLotNum());
|
|
|
- ProductInventory productInventory = productInventoryMapper.selectProductInventoryByLotNumAndProductId(productInventory1);
|
|
|
- if(productInventory != null){
|
|
|
- vo.setInventoryBoxNum(productInventory.getTotalBoxNum());
|
|
|
- vo.setInventoryWeight(handlingWeight(productInventory.getTotalSuttle()));
|
|
|
+ if(saleProductInfoList.size() > 0){
|
|
|
+ ProductInventory productInventory1 = new ProductInventory();
|
|
|
+ productInventory1.setProductId(saleProductInfoList.get(0).getProductId());
|
|
|
+ productInventory1.setLotNum(saleProductInfoList.get(0).getLotNum());
|
|
|
+ ProductInventory productInventory = productInventoryMapper.selectProductInventoryByLotNumAndProductId(productInventory1);
|
|
|
+ if(productInventory != null){
|
|
|
+ vo.setInventoryBoxNum(productInventory.getTotalBoxNum());
|
|
|
+ vo.setInventoryWeight(handlingWeight(productInventory.getTotalSuttle()));
|
|
|
+ }else {
|
|
|
+ vo.setInventoryBoxNum(0);
|
|
|
+ vo.setInventoryWeight(0.0);
|
|
|
+ }
|
|
|
}else {
|
|
|
vo.setInventoryBoxNum(0);
|
|
|
vo.setInventoryWeight(0.0);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//客户编号
|
|
|
vo.setCustomerId(saleOrderMapper.selectCustomerIdBySaleNo(saleOrderNo));
|
|
|
vo.setSaleProductInfoList(saleProductInfoList);
|