Commit 020eaa82 authored by zhangfeng's avatar zhangfeng

feat(wealth): 费用明细查询

parent 44d7f643
......@@ -31,7 +31,7 @@ WHERE approval_time IS NULL AND `status` = 1;
# 刷新银行明细审核核销币种
UPDATE ecw_receipt_item SET write_off_currency_id = 1 WHERE write_off_currency_id IS NULL;
UPDATE ecw_receipt SET generate_path = 0;
UPDATE ecw_receipt SET generate_path = 0 WHERE generate_path IS NULL;
# 刷新应收款优惠金额
UPDATE ecw_receivable er
......
......@@ -737,7 +737,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
ReceiptItemBackVO itemBackVO = ReceiptItemConvert.INSTANCE.convert(receiptItemDO);
ReceiptDO receiptDO = receiptMapper.selectById(receiptItemDO.getReceiptId());
itemBackVO.setReceiptNo(receiptDO.getReceiptNo());
List<ReceivableInItemVO> listForCreateReceiptItem = receivableService.getListForCreateReceiptItem(receiptItemDO.getReceiptId());
List<ReceivableInItemVO> listForCreateReceiptItem = receivableService.getReceivableByReceiptItem(receiptItemDO.getId());
itemBackVO.setReceivableList(listForCreateReceiptItem);
return itemBackVO;
}
......
......@@ -33,7 +33,6 @@ import cn.iocoder.yudao.module.wealth.dal.mysql.receivable.ReceivableMapper;
import cn.iocoder.yudao.module.wealth.dal.mysql.receivable.ReceivableWriteOffRecordMapper;
import cn.iocoder.yudao.module.wealth.service.receipt.ReceiptService;
import cn.iocoder.yudao.module.wealth.service.receivableDiscount.ReceivableDiscountService;
import cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemBackVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -50,6 +49,7 @@ import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.wealth.enums.ErrorCodeConstants.*;
......@@ -264,7 +264,7 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
public List<WealthMoneyAmountVO> receivablePageAmount(ReceivableQueryVO query) {
List<WealthMoneyAmountVO> voList = receivableMapper.receivablePageAmount(query);
Map<Integer, CurrencyRespDTO> allCurrency = currencyApi.getAllCurrency();
voList.forEach(vo -> {
voList.stream().filter(vo -> allCurrency.containsKey(vo.getCurrencyId())).forEach(vo -> {
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
vo.setCurrencyName(allCurrency.get(vo.getCurrencyId()).getTitleZh());
});
......@@ -481,8 +481,10 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
List<WealthMoneyAmountVO> totalStatistics = totalStatisticsFuture.get();
if (CollectionUtil.isNotEmpty(searchStatistics)) {
searchStatistics = searchStatistics.stream().filter(vo -> allCurrency.containsKey(vo.getCurrencyId())).collect(Collectors.toList());
calculateStatisticalAmount(allCurrency, searchStatistics);
}
totalStatistics = totalStatistics.stream().filter(vo -> allCurrency.containsKey(vo.getCurrencyId())).collect(Collectors.toList());
calculateStatisticalAmount(allCurrency, totalStatistics);
CostDetailBackVO.CostDetailBackVOBuilder voBuilder = CostDetailBackVO.builder()
......@@ -502,7 +504,11 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
vo.setWriteOffAmount(BigDecimal.ZERO);
}
vo.setNotWriteOffAmount(vo.getReceivableTotalAmount().subtract(vo.getWriteOffAmount()));
vo.setWriteOffProportion(vo.getWriteOffAmount().divide(vo.getReceivableTotalAmount(), 4, BigDecimal.ROUND_HALF_UP).toString() + "%");
if (vo.getWriteOffAmount().compareTo(BigDecimal.ZERO) <= 0 || vo.getReceivableTotalAmount().compareTo(BigDecimal.ZERO) <= 0) {
vo.setWriteOffProportion("0.00%");
} else {
vo.setWriteOffProportion(vo.getWriteOffAmount().divide(vo.getReceivableTotalAmount(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) + "%");
}
RegionDTO regionCity = regionApi.getRegionById(vo.getDestinationCity().longValue());
vo.setDestinationCityZh(regionCity.getTitleZh());
......@@ -519,10 +525,16 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
.pages(costDetailPage.getPages())
.build();
}
return voBuilder
.list(Collections.EMPTY_LIST)
.total(costDetailPage.getTotal())
.rows(costDetailPage.getSize())
.page(costDetailPage.getCurrent())
.pages(costDetailPage.getPages())
.build();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException("查询异常");
}
return null;
}
/**
......
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