소스 검색

销售收入修改

fgd 1 년 전
부모
커밋
8422b700ca
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      sd-business/src/main/java/com/sd/business/service/statement/impl/StatementOfAccountMergeServiceImpl.java

+ 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())