| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | |
| | | List<SalesLedgerProduct> productList = purchaseLedgerDto.getProductData(); |
| | | if (productList != null && !productList.isEmpty()) { |
| | | handleSalesLedgerProducts(purchaseLedger.getId(), productList, purchaseLedgerDto.getType()); |
| | | |
| | | } |
| | | |
| | | // 5. 迁移临时文件到正式目录 |
| | |
| | | salesLedgerProduct.setType(type); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | } |
| | | } |
| | | |
| | | // 计算总含税金额 |
| | | BigDecimal totalTaxInclusiveAmount = products.stream() |
| | | .map(SalesLedgerProduct::getTaxInclusiveTotalPrice) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | // 更新主表的总金额字段 |
| | | if (salesLedgerId != null) { |
| | | // 直接更新指定ID的记录的contractAmount字段为totalTaxInclusiveAmount |
| | | purchaseLedgerMapper.updateContractAmountById(salesLedgerId, totalTaxInclusiveAmount); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // 获取原始查询结果 |
| | | List<Map<String, Object>> result = purchaseLedgerMapper.selectMaps(queryWrapper); |
| | | |
| | | //查询销售合同号 |
| | | |
| | | |
| | | // 将下划线命名转换为驼峰命名 |
| | | return result.stream().map(map -> map.entrySet().stream() |