|
|
@@ -5954,6 +5954,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
} else {
|
|
|
throw new RuntimeException("生成失败,未查到单据信息");
|
|
|
}
|
|
|
+ order_.setBuyerId(order.getBuyerId());
|
|
|
+ order_.setBuyerId(order.getBuyerId());
|
|
|
order_.setBillType("CG");
|
|
|
order_.setOrderItemsList(orderItemsListAll);
|
|
|
return R.data(order_);
|
|
|
@@ -8536,22 +8538,24 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
List<OrderFees> orderFeesList = orderFeesService.list(new LambdaQueryWrapper<OrderFees>()
|
|
|
.eq(OrderFees::getIsDeleted, 0)
|
|
|
.eq(OrderFees::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(OrderFees::getFeesType, 1)
|
|
|
.eq(OrderFees::getPid, order.getId()));
|
|
|
if (CollectionUtils.isNotEmpty(orderFeesList)) {
|
|
|
- BigDecimal amountCny = orderFeesList.stream().filter(e -> "CNY".equals(e.getCurrency())).map(OrderFees::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- BigDecimal amountUsd = orderFeesList.stream().filter(e -> "USD".equals(e.getCurrency())).map(OrderFees::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+// BigDecimal amountCnyC = orderFeesList.stream().filter(e -> "CNY".equals(e.getCurrency()) && 2 == e.getFeesType()).map(OrderFees::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+// BigDecimal amountUsdC = orderFeesList.stream().filter(e -> "USD".equals(e.getCurrency()) && 2 == e.getFeesType()).map(OrderFees::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal amountCnyD = orderFeesList.stream().filter(e -> "CNY".equals(e.getCurrency()) && 1 == e.getFeesType()).map(OrderFees::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal amountUsdD = orderFeesList.stream().filter(e -> "USD".equals(e.getCurrency()) && 1 == e.getFeesType()).map(OrderFees::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
if ("CNY".equals(order.getCurrency())) {
|
|
|
- amountUsd = amountUsd.multiply(order.getExchangeRate());
|
|
|
- amount = amount.add(amountCny).add(amountUsd);
|
|
|
+// amountUsdC = amountUsdC.multiply(order.getExchangeRate());
|
|
|
+ amountUsdD = amountUsdD.multiply(order.getExchangeRate());
|
|
|
+// amount = amount.add(amountCnyD).add(amountUsdD).subtract(amountCnyC).subtract(amountUsdC);
|
|
|
+ amount = amount.add(amountCnyD).add(amountUsdD);
|
|
|
} else {
|
|
|
- amountCny = amountCny.divide(order.getExchangeRate(), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
- amount = amount.add(amountUsd).add(amountCny);
|
|
|
+// amountCnyC = amountCnyC.divide(order.getExchangeRate(), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ amountCnyD = amountCnyD.divide(order.getExchangeRate(), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+// amount = amount.add(amountCnyD).add(amountUsdD).subtract(amountCnyC).subtract(amountUsdC);
|
|
|
+ amount = amount.add(amountCnyD).add(amountUsdD);
|
|
|
}
|
|
|
}
|
|
|
- if (order.getThisUsedProfit() != null) {
|
|
|
- amount = amount.subtract(order.getThisUsedProfit());
|
|
|
- }
|
|
|
price = amount;
|
|
|
Items items = new Items();
|
|
|
items.setBelongToCorpId(order.getBelongToCorpId());
|