|
@@ -17,10 +17,7 @@ import com.sd.business.entity.statement.dto.FileUploadDto;
|
|
import com.sd.business.entity.statement.dto.StatementOfAccountDto;
|
|
import com.sd.business.entity.statement.dto.StatementOfAccountDto;
|
|
import com.sd.business.entity.statement.dto.StatementOfAccountSelectDto;
|
|
import com.sd.business.entity.statement.dto.StatementOfAccountSelectDto;
|
|
import com.sd.business.entity.statement.po.StatementOfAccount;
|
|
import com.sd.business.entity.statement.po.StatementOfAccount;
|
|
-import com.sd.business.entity.statement.vo.DocumentByBomVo;
|
|
|
|
-import com.sd.business.entity.statement.vo.DocumentBySkuVo;
|
|
|
|
-import com.sd.business.entity.statement.vo.ReconciliationDetailVo;
|
|
|
|
-import com.sd.business.entity.statement.vo.StatementOfAccountVo;
|
|
|
|
|
|
+import com.sd.business.entity.statement.vo.*;
|
|
import com.sd.business.mapper.statement.StatementOfAccountMapper;
|
|
import com.sd.business.mapper.statement.StatementOfAccountMapper;
|
|
import com.sd.business.service.bom.BomSpecService;
|
|
import com.sd.business.service.bom.BomSpecService;
|
|
import com.sd.business.service.department.DepartmentService;
|
|
import com.sd.business.service.department.DepartmentService;
|
|
@@ -212,14 +209,14 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
public List<DocumentBySkuVo> getDocumentBySku(Long statementOfAccountId) {
|
|
public List<DocumentBySkuVo> getDocumentBySku(Long statementOfAccountId) {
|
|
|
|
|
|
// 获取订单id列表
|
|
// 获取订单id列表
|
|
- List<Long> ordedrIdList = getOrderIdList(statementOfAccountId);
|
|
|
|
|
|
+ List<Long> orderIdList = getOrderIdList(statementOfAccountId);
|
|
|
|
|
|
- if (ordedrIdList.size() == 0) {
|
|
|
|
|
|
+ if (orderIdList.size() == 0) {
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
}
|
|
}
|
|
|
|
|
|
// 获取订单sku
|
|
// 获取订单sku
|
|
- List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, ordedrIdList));
|
|
|
|
|
|
+ List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, orderIdList));
|
|
|
|
|
|
// 生成结果集
|
|
// 生成结果集
|
|
List<DocumentBySkuVo> documentBySkuVoList = orderSkuList.stream()
|
|
List<DocumentBySkuVo> documentBySkuVoList = orderSkuList.stream()
|
|
@@ -264,14 +261,14 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
public List<DocumentByBomVo> getDocumentByBom(Long statementOfAccountId) {
|
|
public List<DocumentByBomVo> getDocumentByBom(Long statementOfAccountId) {
|
|
|
|
|
|
// 获取订单id列表
|
|
// 获取订单id列表
|
|
- List<Long> ordedrIdList = getOrderIdList(statementOfAccountId);
|
|
|
|
|
|
+ List<Long> orderIdList = getOrderIdList(statementOfAccountId);
|
|
|
|
|
|
- if (ordedrIdList.size() == 0) {
|
|
|
|
|
|
+ if (orderIdList.size() == 0) {
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
}
|
|
}
|
|
|
|
|
|
// 获取订单sku
|
|
// 获取订单sku
|
|
- List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, ordedrIdList));
|
|
|
|
|
|
+ List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, orderIdList));
|
|
|
|
|
|
// 主材bom
|
|
// 主材bom
|
|
List<DocumentByBomVo> result = orderSkuList.stream()
|
|
List<DocumentByBomVo> result = orderSkuList.stream()
|
|
@@ -325,7 +322,7 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
result = new ArrayList<>(documentByBomVoCollection);
|
|
result = new ArrayList<>(documentByBomVoCollection);
|
|
|
|
|
|
// 包材bom
|
|
// 包材bom
|
|
- List<OrderSkuBom> orderSkuBomList = orderSkuBomService.list(q -> q.in(OrderSkuBom::getOrderId, ordedrIdList));
|
|
|
|
|
|
+ List<OrderSkuBom> orderSkuBomList = orderSkuBomService.list(q -> q.in(OrderSkuBom::getOrderId, orderIdList));
|
|
List<DocumentByBomVo> bomVoList = orderSkuBomList.stream().map(item ->
|
|
List<DocumentByBomVo> bomVoList = orderSkuBomList.stream().map(item ->
|
|
DocumentByBomVo.builder()
|
|
DocumentByBomVo.builder()
|
|
.bomSpecId(item.getBomSpecId())
|
|
.bomSpecId(item.getBomSpecId())
|
|
@@ -362,6 +359,40 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<DocumentByOrderVo> getDocumentByOrder(Long statementOfAccountId) {
|
|
|
|
+ Assert.notNull(statementOfAccountId, "对账单id不能为空");
|
|
|
|
+ List<OrderInfo> orderList = orderService.list(q -> q.eq(OrderInfo::getStatementOfAccountId, statementOfAccountId));
|
|
|
|
+
|
|
|
|
+ List<DocumentByOrderVo> result = orderList.stream().map(item ->
|
|
|
|
+ DocumentByOrderVo.builder()
|
|
|
|
+ .orderId(item.getId())
|
|
|
|
+ .wlnCreateTime(item.getWlnCreateTime())
|
|
|
|
+ .code(item.getCode())
|
|
|
|
+ .wlnCode(item.getWlnCode())
|
|
|
|
+ .build()
|
|
|
|
+ ).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<Long> orderIdList = orderList.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ // 获取订单sku
|
|
|
|
+ List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, orderIdList));
|
|
|
|
+ List<DocumentByOrderVo.SkuSpec.SkuSpecBuilder> collect = orderSkuList.stream()
|
|
|
|
+ .map(item -> DocumentByOrderVo.SkuSpec.builder()
|
|
|
|
+ .skuSpecId(item.getSkuSpecId())
|
|
|
|
+ .quantity(item.getQuantity())
|
|
|
|
+ .unitPrice(item.getUnitPrice()
|
|
|
|
+ .add(item.getCustomProcessingFee())
|
|
|
|
+ .add(item.getLssueFee())
|
|
|
|
+ .add(item.getDeliveryMaterialsFee())
|
|
|
|
+ .add(item.getPackingLabor())
|
|
|
|
+ .add(item.getPackagingMaterialCost())
|
|
|
|
+ )
|
|
|
|
+ ).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据对账单id获取对账订单id列表
|
|
* 根据对账单id获取对账订单id列表
|