| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.ruoyi.account.mapper.AccountExpenseMapper; |
| | | import com.ruoyi.account.mapper.AccountIncomeMapper; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.home.mapper.HomeMapper; |
| | | import com.ruoyi.account.mapper.AccountExpenseMapper; |
| | | import com.ruoyi.approve.mapper.ApproveProcessMapper; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | |
| | | import com.ruoyi.dto.MapDto; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.home.dto.*; |
| | | import com.ruoyi.home.mapper.HomeMapper; |
| | | import com.ruoyi.home.service.HomeService; |
| | | import com.ruoyi.production.mapper.ProductionOperationTaskMapper; |
| | | import com.ruoyi.production.mapper.ProductionAccountMapper; |
| | | import com.ruoyi.production.mapper.ProductionOrderMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductInputMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductOutputMapper; |
| | | import com.ruoyi.production.bean.dto.ProductionProductOutputDto; |
| | | import com.ruoyi.production.mapper.*; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.purchase.mapper.PaymentRegistrationMapper; |
| | |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | @RequiredArgsConstructor |
| | | public class HomeServiceImpl implements HomeService { |
| | | |
| | | @Autowired |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | |
| | | @Autowired |
| | | private PurchaseLedgerMapper purchaseLedgerMapper; |
| | | private final PurchaseLedgerMapper purchaseLedgerMapper; |
| | | |
| | | @Autowired |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | | |
| | | @Autowired |
| | | private StockInventoryMapper stockInventoryMapper; |
| | | private final StockInventoryMapper stockInventoryMapper; |
| | | |
| | | @Autowired |
| | | private QualityInspectMapper qualityStatisticsMapper; |
| | | private final QualityInspectMapper qualityStatisticsMapper; |
| | | |
| | | @Autowired |
| | | private ApproveProcessMapper approveProcessMapper; |
| | | private final ApproveProcessMapper approveProcessMapper; |
| | | |
| | | @Autowired |
| | | private ReceiptPaymentMapper receiptPaymentMapper; |
| | | private final ReceiptPaymentMapper receiptPaymentMapper; |
| | | |
| | | @Autowired |
| | | private PaymentRegistrationMapper paymentRegistrationMapper; |
| | | private final PaymentRegistrationMapper paymentRegistrationMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | |
| | | @Autowired |
| | | private NoticeMapper noticeMapper; |
| | | private final NoticeMapper noticeMapper; |
| | | |
| | | @Autowired |
| | | private ProductionOrderMapper productionOrderMapper; |
| | | private final ProductionOrderMapper productionOrderMapper; |
| | | |
| | | @Autowired |
| | | private ProductMapper productMapper; |
| | | private final ProductMapper productMapper; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | private final StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @Autowired |
| | | private CustomerMapper customerMapper; |
| | | private final CustomerMapper customerMapper; |
| | | |
| | | @Autowired |
| | | private SupplierManageMapper supplierManageMapper; |
| | | private final SupplierManageMapper supplierManageMapper; |
| | | |
| | | @Autowired |
| | | private HomeMapper homeMapper; |
| | | private final HomeMapper homeMapper; |
| | | |
| | | @Autowired |
| | | private ProductionProductOutputMapper productionProductOutputMapper; |
| | | private final ProductionProductOutputMapper productionProductOutputMapper; |
| | | |
| | | @Autowired |
| | | private QualityInspectMapper qualityInspectMapper; |
| | | private final QualityInspectMapper qualityInspectMapper; |
| | | |
| | | @Autowired |
| | | private QualityUnqualifiedMapper qualityUnqualifiedMapper; |
| | | private final QualityUnqualifiedMapper qualityUnqualifiedMapper; |
| | | |
| | | @Autowired |
| | | private ProductionOperationTaskMapper productionOperationTaskMapper; |
| | | |
| | | @Autowired |
| | | private AccountExpenseMapper accountExpenseMapper; |
| | | private final ProductionOperationTaskMapper productionOperationTaskMapper; |
| | | |
| | | @Autowired |
| | | private AccountIncomeMapper accountIncomeMapper; |
| | | private final AccountExpenseMapper accountExpenseMapper; |
| | | |
| | | private final AccountIncomeMapper accountIncomeMapper; |
| | | |
| | | private final ProductionAccountMapper productionAccountMapper; |
| | | |
| | | private final ProductionProductInputMapper productionProductInputMapper; |
| | | |
| | | @Override |
| | | public HomeBusinessDto business() { |
| | |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | |
| | | @Autowired |
| | | |
| | | private DeviceRepairMapper deviceRepairMapper; |
| | | |
| | | @Override |
| | |
| | | return dto; |
| | | } |
| | | |
| | | @Autowired |
| | | private ProductionProductInputMapper productionProductInputMapper; |
| | | |
| | | @Override |
| | | public List<InputOutputAnalysisDto> inputOutputAnalysis(Integer type) { |
| | | LocalDate today = LocalDate.now(); |
| | |
| | | String endStr = endDate.atStartOfDay() |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | List<Map<String, Object>> inputList = productionProductInputMapper.selectInputStats(startStr, endStr); |
| | | // List<Map<String, Object>> inputList = productionProductInputMapper.selectInputStats(startStr, endStr); |
| | | List<Map<String, Object>> inputList = null; |
| | | List<Map<String, Object>> outputList = productionProductOutputMapper.selectDailyOutputStats(startStr, endStr); |
| | | |
| | | Map<String, InputOutputAnalysisDto> dateMap = new HashMap<>(); |
| | |
| | | |
| | | List<ProductionTaskStatisticsDto> startList = productionOperationTaskMapper.selectTaskStartStats(startStr, endStr); |
| | | |
| | | List<com.ruoyi.production.dto.ProductionProductOutputDto> outputList = productionProductOutputMapper |
| | | List<ProductionProductOutputDto> outputList = productionProductOutputMapper |
| | | .selectOutputStats(startStr, endStr); |
| | | |
| | | Map<String, WorkOrderEfficiencyDto> dateMap = new HashMap<>(); |
| | |
| | | |
| | | // 完工数量和良品率 |
| | | if (!CollectionUtils.isEmpty(outputList)) { |
| | | for (com.ruoyi.production.dto.ProductionProductOutputDto item : outputList) { |
| | | for (ProductionProductOutputDto item : outputList) { |
| | | if (item.getCreateTime() != null) { |
| | | String date = item.getCreateTime().toLocalDate().toString(); |
| | | WorkOrderEfficiencyDto dto = dateMap.getOrDefault(date, new WorkOrderEfficiencyDto()); |
| | |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Autowired |
| | | private ProductionAccountMapper salesLedgerProductionAccountingMapper; |
| | | |
| | | @Override |
| | | public List<ProductionAccountingDto> productionAccountingAnalysis(Integer type) { |
| | |
| | | |
| | | String endStr = endDate.plusDays(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | List<Map<String, Object>> wagesList = salesLedgerProductionAccountingMapper.selectDailyWagesStats(startStr, |
| | | List<Map<String, Object>> wagesList = productionAccountMapper.selectDailyWagesStats(startStr, |
| | | endStr); |
| | | |
| | | if (CollectionUtils.isEmpty(wagesList)) { |