bug修复

This commit is contained in:
hongchao 2025-03-18 17:01:20 +08:00
parent b66eb4b9fe
commit 898ed313e6
1 changed files with 4 additions and 2 deletions

View File

@ -348,7 +348,8 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
List<ScrapTotalListVo> list = scrapApplyDetailsMapper.selectTotalScrapApplyDetailsList(scrapApplyDetails);
if (CollectionUtils.isNotEmpty(list)) {
for (ScrapTotalListVo applyDetails : list) {
BigDecimal totalCost = applyDetails.getScrapNum().multiply(applyDetails.getBuyPrice()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
// BigDecimal totalCost = applyDetails.getScrapNum().multiply(applyDetails.getBuyPrice()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
BigDecimal totalCost = applyDetails.getScrapNum().multiply(applyDetails.getBuyPrice()).setScale(2, RoundingMode.HALF_UP);
applyDetails.setTotalCost(totalCost);
List<String> asList = Arrays.asList(applyDetails.getIds().split(","));
List<Long> longList = asList.stream()
@ -501,7 +502,8 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
List<ScrapTotalListVo> list = scrapApplyDetailsMapper.selectTotalScrapApplyDetailsList(scrapApplyDetails);
if (CollectionUtils.isNotEmpty(list)) {
for (ScrapTotalListVo item : list) {
totalCost = totalCost.add(item.getScrapNum().multiply(item.getBuyPrice()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP));
// totalCost = totalCost.add(item.getScrapNum().multiply(item.getBuyPrice()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP));
totalCost = totalCost.add(item.getScrapNum().multiply(item.getBuyPrice()).setScale(2, RoundingMode.HALF_UP));
}
String result = list.stream()
.map(ScrapTotalListVo::getMonth) // 提取 month 属性