| | |
| | | import com.ruoyi.production.mapper.ProductWorkOrderMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductInputMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductOutputMapper; |
| | | import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper; |
| | | import com.ruoyi.production.pojo.ProductWorkOrder; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | |
| | | private CustomerMapper customerMapper; |
| | | @Autowired |
| | | private SupplierManageMapper supplierManageMapper; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | @Autowired |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Autowired |
| | | private HomeMapper homeMapper; |
| | | |
| | |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal subtract1 = todayContractAmount.subtract(lastYearYesterdayContractAmount); // 修改:使用 |
| | | // todayContractAmount 而不是 |
| | | // yesterdayContractAmount |
| | | // todayContractAmount 而不是 |
| | | // yesterdayContractAmount |
| | | // 日环比 |
| | | String chain = ""; |
| | | if (subtract1.compareTo(BigDecimal.ZERO) == 0 |
| | |
| | | } |
| | | // 应收 |
| | | List<SalesLedger> salesLedgers = salesLedgerMapper.selectList(new LambdaQueryWrapper<SalesLedger>() |
| | | // .ge(SalesLedger::getEntryDate, startDate) |
| | | // .lt(SalesLedger::getEntryDate, endDate) |
| | | // .ge(SalesLedger::getEntryDate, startDate) |
| | | // .lt(SalesLedger::getEntryDate, endDate) |
| | | ); |
| | | // BigDecimal receivableMoney = |
| | | // salesLedgers.stream().map(SalesLedger::getContractAmount).reduce(BigDecimal.ZERO, |
| | |
| | | // 应付 |
| | | List<PurchaseLedger> procurementRecords = purchaseLedgerMapper |
| | | .selectList(new LambdaQueryWrapper<PurchaseLedger>() |
| | | // .ge(PurchaseLedger::getEntryDate, startDate) |
| | | // .lt(PurchaseLedger::getEntryDate, endDate) |
| | | // .ge(PurchaseLedger::getEntryDate, startDate) |
| | | // .lt(PurchaseLedger::getEntryDate, endDate) |
| | | ); |
| | | // BigDecimal payableMoney = |
| | | // procurementRecords.stream().map(PurchaseLedger::getContractAmount).reduce(BigDecimal.ZERO, |
| | |
| | | BigDecimal payableMoney = sumAmount(procurementRecords, PurchaseLedger::getContractAmount); |
| | | // 预收 |
| | | List<ReceiptPayment> receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>() |
| | | // .ge(ReceiptPayment::getReceiptPaymentDate, startDate) |
| | | // .lt(ReceiptPayment::getReceiptPaymentDate, endDate) |
| | | // .ge(ReceiptPayment::getReceiptPaymentDate, startDate) |
| | | // .lt(ReceiptPayment::getReceiptPaymentDate, endDate) |
| | | ); |
| | | // BigDecimal advanceMoney = |
| | | // receiptPayments.stream().map(ReceiptPayment::getReceiptPaymentAmount).reduce(BigDecimal.ZERO, |
| | |
| | | // 预付 |
| | | List<PaymentRegistration> paymentRegistrations = paymentRegistrationMapper |
| | | .selectList(new LambdaQueryWrapper<PaymentRegistration>() |
| | | // .ge(PaymentRegistration::getPaymentDate, startDate) |
| | | // .lt(PaymentRegistration::getPaymentDate, endDate) |
| | | // .ge(PaymentRegistration::getPaymentDate, startDate) |
| | | // .lt(PaymentRegistration::getPaymentDate, endDate) |
| | | ); |
| | | // BigDecimal prepayMoney = |
| | | // paymentRegistrations.stream().map(PaymentRegistration::getCurrentPaymentAmount).reduce(BigDecimal.ZERO, |
| | |
| | | productionProgressDto.setCompletedOrderDetails(productOrderDtos); |
| | | long totalCount = productOrderDtos.size(); |
| | | long count = productOrderDtos.stream().filter( |
| | | productOrderDto -> productOrderDto.getCompleteQuantity().compareTo(productOrderDto.getQuantity()) >= 0) |
| | | productOrderDto -> productOrderDto.getCompleteQuantity().compareTo(productOrderDto.getQuantity()) >= 0) |
| | | .count(); |
| | | long count2 = productOrderDtos.stream() |
| | | .filter(productOrderDto -> productOrderDto.getCompleteQuantity().compareTo(BigDecimal.ZERO) == 0) |
| | |
| | | |
| | | for (SysDept dept : depts) { |
| | | if ("0".equals(dept.getStatus()) && "0".equals(dept.getDelFlag())) { |
| | | Long count = sysUserDeptMapper.selectCount(new LambdaQueryWrapper<SysUserDept>() |
| | | .eq(SysUserDept::getDeptId, dept.getDeptId())); |
| | | if (count > 0) { |
| | | Long count = staffOnJobMapper.selectCount(new QueryWrapper<StaffOnJob>() |
| | | .eq("sys_dept_id", dept.getDeptId()).eq("staff_state", 1)); |
| | | if (count != null && count > 0) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", dept.getDeptName()); |
| | | map.put("count", count); |
| | |
| | | } |
| | | |
| | | private Long countStaff(LocalDateTime dateTime) { |
| | | Long sysUserCount = sysUserMapper.selectCount(new LambdaQueryWrapper<SysUser>() |
| | | .eq(SysUser::getDelFlag, "0") |
| | | .le(SysUser::getCreateTime, dateTime)); |
| | | Long staffCountItem = staffOnJobMapper.selectCount(new LambdaQueryWrapper<StaffOnJob>() |
| | | .isNotNull(StaffOnJob::getStaffState) |
| | | .eq(StaffOnJob::getStaffState, 1) |
| | | .le(StaffOnJob::getCreateTime, dateTime)); |
| | | return sysUserCount + staffCountItem; |
| | | return staffCountItem; |
| | | } |
| | | |
| | | private Long countCustomers(LocalDateTime dateTime) { |
| | |
| | | } |
| | | |
| | | @Autowired |
| | | private com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper; |
| | | private SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper; |
| | | |
| | | @Override |
| | | public List<MapDto> productionAccountingAnalysis(Integer type) { |
| | | public List<ProductionAccountingDto> productionAccountingAnalysis(Integer type) { |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDate startDate; |
| | | LocalDate endDate = today; |
| | |
| | | break; |
| | | } |
| | | |
| | | String startStr = startDate.atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | String endStr = endDate.atTime(LocalTime.MAX).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | String startStr = startDate.atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | List<Map<String, Object>> wagesList = salesLedgerProductionAccountingMapper.selectDailyWagesStats(startStr, |
| | | endStr); |
| | | String endStr = endDate.plusDays(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | List<Map<String, Object>> wagesList = salesLedgerProductionAccountingMapper.selectDailyWagesStats(startStr, endStr); |
| | | |
| | | if (CollectionUtils.isEmpty(wagesList)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | List<MapDto> result = new ArrayList<>(); |
| | | List<ProductionAccountingDto> result = new ArrayList<>(); |
| | | for (Map<String, Object> map : wagesList) { |
| | | MapDto dto = new MapDto(); |
| | | dto.setName((String) map.get("date")); |
| | | BigDecimal wages = (BigDecimal) map.get("wages"); |
| | | dto.setValue(wages != null ? wages.toString() : "0"); |
| | | ProductionAccountingDto dto = new ProductionAccountingDto(); |
| | | dto.setDateStr(map.get("dateStr").toString()); |
| | | dto.setNumberOfCompleted(((BigDecimal) map.get("numberOfCompleted")).intValue()); |
| | | dto.setAmount(map.get("amount") != null ? (BigDecimal) map.get("amount") : BigDecimal.ZERO); |
| | | dto.setPassRate(map.get("passRate") != null ? (BigDecimal) map.get("passRate") : BigDecimal.ZERO); |
| | | result.add(dto); |
| | | } |
| | | |
| | | result.sort(Comparator.comparing(MapDto::getName)); |
| | | result.sort(Comparator.comparing(ProductionAccountingDto::getDateStr)); |
| | | |
| | | return result; |
| | | } |