Commit 0d1713c3 authored by zhangfeng's avatar zhangfeng

feat(wealth): 费用明细状态改为订单状态

parent 7c732a99
...@@ -449,37 +449,11 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec ...@@ -449,37 +449,11 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
IPage<CostDetailPageVO> costDetailPage = costDetailPageFuture.get(); IPage<CostDetailPageVO> costDetailPage = costDetailPageFuture.get();
List<WealthMoneyAmountVO> searchStatistics = searchStatisticsFuture.get(); List<WealthMoneyAmountVO> searchStatistics = searchStatisticsFuture.get();
List<WealthMoneyAmountVO> totalStatistics = totalStatisticsFuture.get(); List<WealthMoneyAmountVO> totalStatistics = totalStatisticsFuture.get();
// 计算库中不存在的金额字段
// TODO 暂定 不含税金额 = 总金额
// 实际金额 = 含税金额 - 优惠金额
// 未核销金额 = 实际金额 - 核销金额
if (CollectionUtil.isNotEmpty(searchStatistics)) { if (CollectionUtil.isNotEmpty(searchStatistics)) {
searchStatistics.forEach(vo -> { calculateStatisticalAmount(allCurrency, searchStatistics);
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
vo.setCurrencyName(allCurrency.get(vo.getCurrencyId()).getTitleZh());
if (vo.getWriteOffAmount() == null) {
vo.setWriteOffAmount(BigDecimal.ZERO);
}
if (vo.getDiscountTotal() == null) {
vo.setDiscountTotal(BigDecimal.ZERO);
}
vo.setReceivableTotalAmount(vo.getTaxAmount().subtract(vo.getDiscountTotal()));
vo.setNotWriteOffAmount(vo.getReceivableTotalAmount().subtract(vo.getWriteOffAmount()));
});
} }
totalStatistics.forEach(vo -> { calculateStatisticalAmount(allCurrency, totalStatistics);
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
vo.setCurrencyName(allCurrency.get(vo.getCurrencyId()).getTitleZh());
if (vo.getWriteOffAmount() == null) {
vo.setWriteOffAmount(BigDecimal.ZERO);
}
if (vo.getDiscountTotal() == null) {
vo.setDiscountTotal(BigDecimal.ZERO);
}
vo.setNotIncludedTaxAmount(vo.getTotalAmount());
vo.setReceivableTotalAmount(vo.getTaxAmount().subtract(vo.getDiscountTotal()));
vo.setNotWriteOffAmount(vo.getReceivableTotalAmount().subtract(vo.getWriteOffAmount()));
});
CostDetailBackVO.CostDetailBackVOBuilder voBuilder = CostDetailBackVO.builder() CostDetailBackVO.CostDetailBackVOBuilder voBuilder = CostDetailBackVO.builder()
.searchStatistics(searchStatistics) .searchStatistics(searchStatistics)
...@@ -521,6 +495,29 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec ...@@ -521,6 +495,29 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
return null; return null;
} }
/**
* 实际金额 = 含税金额 - 优惠金额
* 未核销金额 = 实际金额 - 核销金额
* TODO 暂定 不含税金额 = 总金额
* @param allCurrency
* @param statistics
*/
private void calculateStatisticalAmount(Map<Integer, CurrencyRespDTO> allCurrency, List<WealthMoneyAmountVO> statistics) {
statistics.forEach(vo -> {
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
vo.setCurrencyName(allCurrency.get(vo.getCurrencyId()).getTitleZh());
if (vo.getWriteOffAmount() == null) {
vo.setWriteOffAmount(BigDecimal.ZERO);
}
if (vo.getDiscountTotal() == null) {
vo.setDiscountTotal(BigDecimal.ZERO);
}
vo.setNotIncludedTaxAmount(vo.getTotalAmount());
vo.setReceivableTotalAmount(vo.getTaxAmount().subtract(vo.getDiscountTotal()));
vo.setNotWriteOffAmount(vo.getReceivableTotalAmount().subtract(vo.getWriteOffAmount()));
});
}
@Override @Override
public PageResult<BatchGenReceiptPageVO> batchGenReceiptPage(BatchGenReceiptPageQueryVO query, PageVO page) { public PageResult<BatchGenReceiptPageVO> batchGenReceiptPage(BatchGenReceiptPageQueryVO query, PageVO page) {
int start = (page.getPage() - 1) * page.getRows(); int start = (page.getPage() - 1) * page.getRows();
......
...@@ -43,6 +43,6 @@ public class CostDetailPageQueryVO { ...@@ -43,6 +43,6 @@ public class CostDetailPageQueryVO {
@ApiModelProperty(value = "收款类型(字典 payment_type)(多选)") @ApiModelProperty(value = "收款类型(字典 payment_type)(多选)")
private List<Integer> collectionType; private List<Integer> collectionType;
@ApiModelProperty(value = "收款状态(0未收款,1收款中,2已收款)(多选)") @ApiModelProperty(value = "订单状态详情见字典:order_status")
private Integer state; private Integer status;
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
o.order_no, o.order_no,
o.transport_id, o.transport_id,
o.channel_id, o.channel_id,
o.status,
de.departure_warehouse_id, de.departure_warehouse_id,
ob.objective_warehouse_id, ob.objective_warehouse_id,
dew.title_zh departure_warehouse_zh, dew.title_zh departure_warehouse_zh,
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
SUM(r.discount_total) AS discount_total, SUM(r.discount_total) AS discount_total,
SUM(r.write_off_amount) AS write_off_amount SUM(r.write_off_amount) AS write_off_amount
FROM ecw_receivable r FROM ecw_receivable r
<if test="query.transportId != null or query.shipmentChannel != null"> <if test="query.transportId != null or query.shipmentChannel != null or query.status != null">
LEFT JOIN ecw_order o ON o.order_id = r.order_id LEFT JOIN ecw_order o ON o.order_id = r.order_id
</if> </if>
<if test="query.departureWareHouseId != null"> <if test="query.departureWareHouseId != null">
...@@ -148,8 +149,8 @@ ...@@ -148,8 +149,8 @@
</foreach> </foreach>
</if> </if>
</if> </if>
<if test="query.state != null"> <if test="query.status != null">
AND r.state = #{query.state} AND o.status = #{query.status}
</if> </if>
</sql> </sql>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment