fgd 1 год назад
Родитель
Сommit
8422b700ca

+ 10 - 0
sd-business/src/main/java/com/sd/business/service/statement/impl/StatementOfAccountMergeServiceImpl.java

@@ -17,6 +17,7 @@ import com.sd.business.entity.excel.enums.ExcelTypeEnum;
 import com.sd.business.entity.inventory.po.InventoryFinishedOrder;
 import com.sd.business.entity.inventory.po.InventoryFinishedOrderDetail;
 import com.sd.business.entity.order.enums.OrderClassifyEnum;
+import com.sd.business.entity.order.enums.OrderStatusEnum;
 import com.sd.business.entity.order.po.OrderInfo;
 import com.sd.business.entity.order.po.OrderSku;
 import com.sd.business.entity.order.po.OrderSkuProductionCost;
@@ -394,6 +395,7 @@ public class StatementOfAccountMergeServiceImpl implements StatementOfAccountMer
 
         // 查询订单分页
         orderService.page(page, Wrappers.lambdaQuery(OrderInfo.class)
+                .eq(OrderInfo::getStatus, OrderStatusEnum.COMPLETION_PRODUCTION.getKey())
                 .in(ObjectUtil.isNotEmpty(orderIdList), BaseIdPo::getId, orderIdList)
                 .in(ObjectUtil.isNotEmpty(statementOfAccountIdList), OrderInfo::getStatementOfAccountId, statementOfAccountIdList)
                 .isNotNull(ObjectUtil.isEmpty(statementOfAccountIdList), OrderInfo::getStatementOfAccountId)
@@ -435,6 +437,14 @@ public class StatementOfAccountMergeServiceImpl implements StatementOfAccountMer
                     String height = skuSpecBo.getHeight() == null ? "0" : skuSpecBo.getHeight().stripTrailingZeros().toPlainString();
 
                     OrderSkuProductionCost productionCost = productionCostMap.get(item.getId());
+                    if (productionCost == null) {
+                        productionCost = new OrderSkuProductionCost();
+                        productionCost.setMaterialCost(BigDecimal.ZERO);
+                        productionCost.setAuxiliaryMaterialCost(BigDecimal.ZERO);
+                        productionCost.setProductPackagingMaterialCost(BigDecimal.ZERO);
+                        productionCost.setLogisticsPackagingMaterialCost(BigDecimal.ZERO);
+                        productionCost.setTotalAmount(BigDecimal.ZERO);
+                    }
 
                     return DocumentByRevenueCostVo.builder()
                             .orderId(item.getOrderId())