| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.dto.DeviceTypeDetail; |
| | | import com.ruoyi.account.dto.DeviceTypeDistributionVO; |
| | | import com.ruoyi.account.mapper.BorrowInfoMapper; |
| | | import com.ruoyi.account.pojo.BorrowInfo; |
| | | import com.ruoyi.account.bean.dto.DeviceTypeDetail; |
| | | import com.ruoyi.account.bean.dto.DeviceTypeDistributionVO; |
| | | import com.ruoyi.device.mapper.DeviceLedgerMapper; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | |
| | | public class AccountingServiceImpl { |
| | | |
| | | private final DeviceLedgerMapper deviceLedgerMapper; |
| | | private final BorrowInfoMapper borrowInfoMapper; |
| | | private final CustomStorageMapper customStorageMapper; |
| | | private final ProcurementRecordMapper procurementRecordMapper; |
| | | private final ProcurementRecordOutMapper procurementRecordOutMapper; |
| | |
| | | map.put("netValue",reduce.subtract(total)); |
| | | } |
| | | // 负债 |
| | | LambdaQueryWrapper<BorrowInfo> borrowInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | borrowInfoLambdaQueryWrapper.like(BorrowInfo::getCreateTime,year) |
| | | .eq(BorrowInfo::getStatus,1); |
| | | List<BorrowInfo> borrowInfos = borrowInfoMapper.selectList(borrowInfoLambdaQueryWrapper); |
| | | if(CollectionUtils.isNotEmpty(borrowInfos)){ |
| | | BigDecimal reduce = borrowInfos.stream() |
| | | .map(BorrowInfo::getBorrowAmount) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | map.put("debt",reduce); |
| | | } |
| | | map.put("debt",BigDecimal.ZERO); |
| | | |
| | | // 库存资产 |
| | | LambdaQueryWrapper<ProcurementRecordStorage> procurementRecordStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordStorageLambdaQueryWrapper.like(ProcurementRecordStorage::getCreateTime,year); |