From 277b5047d00a3e9094bafd5ecb078976fbf6a92d Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期四, 08 一月 2026 18:59:04 +0800
Subject: [PATCH] 华玺砂浆转移-采购代码、发货和发货审核、报修和报修审核、采购模板,查询采购模板接口、财务管理的存货核算数据接口、财务管理的固定资产核算获取台账接口、采购审批,接口、客户分类字段、采购台账字段,实现采购异常记录的添加接口、黑名单,添加资质管理字段,可上传资质文件-至军泰伟业
---
src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java | 62 +++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java b/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
index fdd9c7c..3820823 100644
--- a/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -416,6 +416,68 @@
}
@Override
+ public InventoryInformationDto getReportList() {
+ InventoryInformationDto inventoryInformationDto = new InventoryInformationDto();
+ IPage<ProcurementPageDto> procurementPageDtoIPage = this.listPage(new Page<>(1, -1), new ProcurementPageDto());
+ if(CollectionUtils.isEmpty(procurementPageDtoIPage.getRecords())){
+ return inventoryInformationDto;
+ }
+ // 璁$畻鎬诲簱瀛樻暟閲�
+ inventoryInformationDto.setTotalInventoryCount(procurementPageDtoIPage.getRecords().stream()
+ .map(ProcurementPageDto::getInboundNum0)
+ .reduce(BigDecimal.ZERO, BigDecimal::add)
+ .intValue());
+ // 璁$畻鎬诲簱瀛橀噾棰�-ProcurementPageDto閲屾瘡涓璞$殑inboundNum0鍊煎拰taxInclusiveUnitPrice鐨勪箻绉紝涔嬪悗鐩稿姞寰楀埌鎬诲簱瀛橀噾棰�
+ BigDecimal totalInventoryValue = procurementPageDtoIPage.getRecords().stream()
+ // 杩囨护绌哄璞★紝閬垮厤NPE
+ .filter(Objects::nonNull)
+ // 澶勭悊姣忎釜瀵硅薄鐨勭┖鍊硷細null杞负0
+ .map(dto -> {
+ // 鍏ュ簱鏁伴噺锛歯ull 鈫� 0
+ BigDecimal inboundNum0 = Optional.ofNullable(dto.getInboundNum0()).orElse(BigDecimal.ZERO);
+ // 鍚◣鍗曚环锛歯ull 鈫� 0
+ BigDecimal taxInclusiveUnitPrice = Optional.ofNullable(dto.getTaxInclusiveUnitPrice()).orElse(BigDecimal.ZERO);
+ // 璁$畻鍗曚釜瀵硅薄鐨勫簱瀛橀噾棰濓細鏁伴噺 脳 鍚◣鍗曚环
+ return inboundNum0.multiply(taxInclusiveUnitPrice);
+ })
+ // 鎵�鏈夊崟涓噾棰濇眰鍜岋紝鍒濆鍊间负0
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
+ // 璁剧疆鎬诲簱瀛橀噾棰�
+ inventoryInformationDto.setTotalInventoryValue(totalInventoryValue);
+ // 璁$畻搴撳瓨鍙樺姩鏁伴噺-ProcurementPageDto閲屾瘡涓璞$殑inboundNum鍊煎拰inboundNum0鍊肩殑宸�硷紝涔嬪悗鐩稿姞寰楀埌搴撳瓨鍙樺姩鏁伴噺
+ inventoryInformationDto.setInventoryChangeCount(procurementPageDtoIPage.getRecords().stream()
+ // 杩囨护绌哄璞★紝閬垮厤NPE
+ .filter(Objects::nonNull)
+ // 澶勭悊姣忎釜瀵硅薄鐨勭┖鍊硷細null杞负0
+ .map(dto -> {
+ // 鍏ュ簱鏁伴噺锛歯ull 鈫� 0
+ BigDecimal inboundNum = Optional.ofNullable(dto.getInboundNum()).orElse(BigDecimal.ZERO);
+ // 寰呭嚭搴撴暟閲忥細null 鈫� 0
+ BigDecimal inboundNum0 = Optional.ofNullable(dto.getInboundNum0()).orElse(BigDecimal.ZERO);
+ // 璁$畻鍗曚釜瀵硅薄鐨勫簱瀛樺彉鍔ㄦ暟閲忥細鏁伴噺 - 寰呭嚭搴撴暟閲�
+ return inboundNum.subtract(inboundNum0);
+ })
+ // 鎵�鏈夊崟涓彉鍔ㄦ暟閲忔眰鍜岋紝鍒濆鍊间负0
+ .reduce(BigDecimal.ZERO, BigDecimal::add)
+ .intValue());
+ // 璁$畻搴撳瓨鍙樺姩閲戦ProcurementPageDto閲屾瘡涓璞$殑taxInclusiveTotalPrice鍊肩殑鍜�
+ BigDecimal inventoryChangeValue = procurementPageDtoIPage.getRecords().stream()
+ // 杩囨护绌哄璞★紝閬垮厤NPE
+ .filter(Objects::nonNull)
+ // 澶勭悊姣忎釜瀵硅薄鐨勭┖鍊硷細null杞负0
+ .map(dto -> {
+ // 鍚◣鎬讳环锛歯ull 鈫� 0
+ BigDecimal taxInclusiveTotalPrice = Optional.ofNullable(dto.getTaxInclusiveTotalPrice()).orElse(BigDecimal.ZERO);
+ // 璁$畻鍗曚釜瀵硅薄鐨勫叆搴撳簱瀛橀噾棰濓細鍚◣鎬讳环
+ return taxInclusiveTotalPrice;
+ })
+ // 鎵�鏈夊崟涓彉鍔ㄩ噾棰濇眰鍜岋紝鍒濆鍊间负0
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
+ // 璁剧疆搴撳瓨鍙樺姩閲戦
+ inventoryInformationDto.setInventoryChangeValue(inventoryChangeValue.subtract(totalInventoryValue));
+ return inventoryInformationDto;
+ }
+ @Override
public IPage<ProcurementPageDto> listPageByProduction(Page page, ProcurementPageDto procurementDto) {
IPage<ProcurementPageDto> procurementPageDtoIPage = procurementRecordMapper.listPageByProduction(page, procurementDto);
List<ProcurementPageDto> procurementPageDtos = procurementPageDtoIPage.getRecords();
--
Gitblit v1.9.3