| | |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveId, approveNode.getApproveProcessId()) |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveStatus, 0) |
| | | .last("limit 1"); |
| | | ApproveProcess approveProcess = approveProcessMapper.selectOne(approveProcessLambdaQueryWrapper); |
| | | if(approveProcess == null) throw new RuntimeException("审æ¹ä¸åå¨"); |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºåç±»å") |
| | | @Excel(name = "ä¾åºåç±»å") |
| | | private String supplierType; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºååç§°") |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | |
| | | CUSTOMIZATION_STOCK_IN("0", "åæ ¼èªå®ä¹å
¥åº"), |
| | | PRODUCTION_REPORT_STOCK_IN("2", "ç产æ¥å·¥-å
¥åº"), |
| | | PURCHASE_STOCK_IN("7", "éè´-å
¥åº"), |
| | | QUALITYINSPECT_STOCK_IN("11", "è´¨æ£-åæ ¼å
¥åº"), |
| | | QUALITYINSPECT_STOCK_IN("6", "è´¨æ£-åæ ¼å
¥åº"), |
| | | DEFECTIVE_PASS("11", "ä¸åæ ¼-è®©æ¥æ¾è¡"); |
| | | |
| | | |
| | |
| | | public enum StockInUnQualifiedRecordTypeEnum implements BaseEnum<String> { |
| | | |
| | | |
| | | DEFECTIVE_SCRAP("5", "ä¸åæ ¼å¤ç-æ¥åº"), |
| | | DEFECTIVE_SCRAP("4", "ä¸åæ ¼å¤ç-æ¥åº"), |
| | | PRODUCTION_SCRAP("5", "ç产æ¥å·¥-æ¥åº"), |
| | | CUSTOMIZATION_UNSTOCK_IN("9", "ä¸åæ ¼èªå®ä¹å
¥åº"), |
| | | QUALITYINSPECT_UNSTOCK_IN("12", "è´¨æ£-ä¸åæ ¼å
¥åº"); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.home.annotation; |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç»è®¡ç±»åé»è®¤å¼æ³¨è§£ |
| | | * é»è®¤ type = 1 |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/5 |
| | | */ |
| | | |
| | | @Target(ElementType.PARAMETER) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface DefaultType { |
| | | |
| | | String value() default "1"; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.home.aspectj; |
| | | |
| | | import com.ruoyi.home.annotation.DefaultType; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.lang.reflect.Parameter; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç»è®¡ç±»åé»è®¤å¼æ³¨è§£åé¢ |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/5 |
| | | */ |
| | | |
| | | @Aspect |
| | | @Component |
| | | public class DefaultTypeAspect { |
| | | |
| | | @Around("execution(* com.ruoyi.home.controller.*.*(.., @com.ruoyi.home.annotation.DefaultType (*), ..))") |
| | | public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | Object[] args = joinPoint.getArgs(); |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | Parameter[] parameters = signature.getMethod().getParameters(); |
| | | |
| | | for (int i = 0; i < parameters.length; i++) { |
| | | DefaultType annotation = parameters[i].getAnnotation(DefaultType.class); |
| | | if (annotation != null && args[i] == null) { |
| | | args[i] = Integer.parseInt(annotation.value()); |
| | | } |
| | | } |
| | | return joinPoint.proceed(args); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.home.annotation.DefaultType; |
| | | import com.ruoyi.home.dto.*; |
| | | import com.ruoyi.home.service.HomeService; |
| | | import com.ruoyi.dto.MapDto; |
| | |
| | | /********************************************************è¥ééè´ç±»**************************************************/ |
| | | @GetMapping("/supplierPurchaseRanking") |
| | | @ApiOperation("ä¾åºåéè´æå") |
| | | public AjaxResult supplierPurchaseRanking(@RequestParam(value = "type", defaultValue = "1") Integer type) { |
| | | public AjaxResult supplierPurchaseRanking(@DefaultType Integer type) { |
| | | List<SupplierPurchaseRankingDto> list = homeService.supplierPurchaseRanking(type); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/customerRevenueAnalysis") |
| | | @ApiOperation("客æ·è¥æ¶è´¡ç®æ°å¼åæ") |
| | | public AjaxResult customerRevenueAnalysis(@RequestParam("customerId") Long customerId, @RequestParam(value = "type", defaultValue = "1") Integer type) { |
| | | public AjaxResult customerRevenueAnalysis(Long customerId, @DefaultType Integer type) { |
| | | CustomerRevenueAnalysisDto dto = homeService.customerRevenueAnalysis(customerId, type); |
| | | return AjaxResult.success(dto); |
| | | } |
| | | |
| | | @GetMapping("/customerContributionRanking") |
| | | @ApiOperation("客æ·éé¢è´¡ç®æå") |
| | | public AjaxResult customerContributionRanking(@RequestParam(value = "type", defaultValue = "1") Integer type) { |
| | | public AjaxResult customerContributionRanking(@DefaultType Integer type) { |
| | | List<CustomerContributionRankingDto> list = homeService.customerContributionRanking(type); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | /********************************************************ç产类*****************************************************/ |
| | | @GetMapping("/inputOutputAnalysis") |
| | | @ApiOperation("æå
¥äº§åºåæ") |
| | | public AjaxResult inputOutputAnalysis(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult inputOutputAnalysis(@DefaultType Integer type){ |
| | | List<InputOutputAnalysisDto> list = homeService.inputOutputAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/processOutputAnalysis") |
| | | @ApiOperation("å·¥åºäº§åºåæ") |
| | | public AjaxResult processOutputAnalysis(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult processOutputAnalysis(@DefaultType Integer type){ |
| | | List<MapDto> list = homeService.processOutputAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/workOrderEfficiencyAnalysis") |
| | | @ApiOperation("å·¥åæ§è¡æçåæ") |
| | | public AjaxResult workOrderEfficiencyAnalysis(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult workOrderEfficiencyAnalysis(@DefaultType Integer type){ |
| | | List<WorkOrderEfficiencyDto> list = homeService.workOrderEfficiencyAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/productionAccountingAnalysis") |
| | | @ApiOperation("çäº§æ ¸ç®åæ") |
| | | public AjaxResult productionAccountingAnalysis(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult productionAccountingAnalysis(@DefaultType Integer type){ |
| | | List<ProductionAccountingDto> list = homeService.productionAccountingAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | return AjaxResult.success(productionTurnoverDto); |
| | | } |
| | | |
| | | @GetMapping("/processDataProductionStatistics") |
| | | @ApiOperation("å·¥åºæ°æ®ç产ç»è®¡æ°æ®") |
| | | public AjaxResult processDataProductionStatistics(@DefaultType Integer type,@RequestParam(required = false) List<Long> processIds) { |
| | | List<processDataProductionStatisticsDto> list = homeService.processDataProductionStatistics(type, processIds); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /********************************************************è´¨éç±»*****************************************************/ |
| | | @GetMapping("/rawMaterialDetection") |
| | | @ApiOperation("åæææ£æµ") |
| | | public AjaxResult rawMaterialDetection(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult rawMaterialDetection(@DefaultType Integer type){ |
| | | return AjaxResult.success(homeService.rawMaterialDetection(type)); |
| | | } |
| | | |
| | | @GetMapping("/processDetection") |
| | | @ApiOperation("è¿ç¨æ£æµ") |
| | | public AjaxResult processDetection(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult processDetection(@DefaultType Integer type){ |
| | | return AjaxResult.success(homeService.processDetection(type)); |
| | | } |
| | | |
| | | @GetMapping("/factoryDetection") |
| | | @ApiOperation("æååºåæ£æµ") |
| | | public AjaxResult factoryDetection(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult factoryDetection(@DefaultType Integer type){ |
| | | return AjaxResult.success(homeService.factoryDetection(type)); |
| | | } |
| | | |
| | |
| | | return AjaxResult.success(qualityStatisticsDto); |
| | | } |
| | | |
| | | @GetMapping("/qualityInspectionStatistics") |
| | | @ApiOperation("è´¨éç»è®¡") |
| | | public AjaxResult qualityInspectionStatistics(@DefaultType Integer type) { |
| | | QualityStatisticsDto dto = homeService.qualityInspectionStatistics(type); |
| | | return AjaxResult.success(dto); |
| | | } |
| | | |
| | | /********************************************************è´¢å¡ç±»*****************************************************/ |
| | | @GetMapping("/incomeExpenseAnalysis") |
| | | @ApiOperation("æ¯æ¶å¯¹æ¯åæ") |
| | | public AjaxResult incomeExpenseAnalysis(@RequestParam(value = "type", defaultValue = "1") Integer type) { |
| | | public AjaxResult incomeExpenseAnalysis(@DefaultType Integer type) { |
| | | List<Map<String, Object>> result = homeService.incomeExpenseAnalysis(type); |
| | | return AjaxResult.success(result); |
| | | } |
| | |
| | | |
| | | @GetMapping("/expenseCompositionAnalysis") |
| | | @ApiOperation("ææåæ") |
| | | public AjaxResult expenseCompositionAnalysis(@RequestParam(value = "type", defaultValue = "1") Integer type) { |
| | | public AjaxResult expenseCompositionAnalysis(@DefaultType Integer type) { |
| | | List<MapDto> list = homeService.expenseCompositionAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | @GetMapping("/statisticsReceivablePayable") |
| | | @Log(title = "åºæ¶åºä»ç»è®¡", businessType = BusinessType.OTHER) |
| | | @ApiOperation("åºæ¶åºä»ç»è®¡") |
| | | public AjaxResult statisticsReceivablePayable(StatisticsReceivablePayableDto req, @RequestParam(value = "type", defaultValue = "1") Integer type ) { |
| | | public AjaxResult statisticsReceivablePayable(StatisticsReceivablePayableDto req, @DefaultType Integer type ) { |
| | | StatisticsReceivablePayableDto statisticsReceivablePayable = homeService.statisticsReceivablePayable(type); |
| | | return AjaxResult.success(statisticsReceivablePayable); |
| | | } |
| | |
| | | |
| | | @GetMapping("/productInOutAnalysis") |
| | | @ApiOperation("产ååºå
¥åºåæ") |
| | | public AjaxResult productInOutAnalysis(@RequestParam(value = "type", defaultValue = "1") Integer type){ |
| | | public AjaxResult productInOutAnalysis(@DefaultType Integer type){ |
| | | List<Map<String, Object>> result = homeService.productInOutAnalysis(type); |
| | | return AjaxResult.success(result); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.home.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <br> |
| | | * å·¥åºæ°æ®ç产ç»è®¡æç»Dto |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/5 |
| | | */ |
| | | |
| | | @Data |
| | | public class processDataProductionStatisticsDto { |
| | | |
| | | /** |
| | | * å·¥åºåç§° |
| | | */ |
| | | private String processName; |
| | | |
| | | /** |
| | | * ç´¯è®¡æ»æå
¥ |
| | | */ |
| | | private BigDecimal totalInput; |
| | | |
| | | /** |
| | | * ç´¯å æ»æ¥åº |
| | | */ |
| | | private BigDecimal totalScrap; |
| | | |
| | | /** |
| | | * ç´¯å æ»äº§åº |
| | | */ |
| | | private BigDecimal totalOutput; |
| | | |
| | | } |
| | |
| | | List<UnqualifiedProductRankDto> unqualifiedProductRanking(); |
| | | |
| | | List<MapDto> unqualifiedProductProcessingAnalysis(); |
| | | |
| | | QualityStatisticsDto qualityInspectionStatistics(Integer type); |
| | | |
| | | List<processDataProductionStatisticsDto> processDataProductionStatistics(Integer type, List<Long> processIds); |
| | | } |
| | |
| | | import com.ruoyi.production.dto.ProductOrderDto; |
| | | import com.ruoyi.production.dto.ProductWorkOrderDto; |
| | | import com.ruoyi.production.mapper.ProductOrderMapper; |
| | | import com.ruoyi.production.mapper.ProductProcessMapper; |
| | | 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.ProductProcess; |
| | | import com.ruoyi.production.pojo.ProductWorkOrder; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.domain.SysUserDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.purchase.mapper.PaymentRegistrationMapper; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.pojo.PaymentRegistration; |
| | |
| | | |
| | | @Autowired |
| | | private QualityUnqualifiedMapper qualityUnqualifiedMapper; |
| | | |
| | | @Autowired |
| | | private ProductProcessMapper productProcessMapper; |
| | | |
| | | @Override |
| | | public HomeBusinessDto business() { |
| | |
| | | } |
| | | // åºæ¶ |
| | | 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) |
| | |
| | | BigDecimal finishQty = item.getQuantity() != null ? item.getQuantity() : BigDecimal.ZERO; |
| | | BigDecimal scrapQty = item.getScrapQty() != null ? item.getScrapQty() : BigDecimal.ZERO; |
| | | |
| | | dto.setFinishQuantity(dto.getFinishQuantity() != null ? dto.getFinishQuantity().add(finishQty) : finishQty); |
| | | dto.setFinishQuantity( |
| | | dto.getFinishQuantity() != null ? dto.getFinishQuantity().add(finishQty) : finishQty); |
| | | } |
| | | } |
| | | |
| | |
| | | return dto; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public QualityQualifiedAnalysisDto rawMaterialDetection(Integer type) { |
| | | return commonDetection(type, 0); |
| | |
| | | endDate = today.with(DayOfWeek.SUNDAY); |
| | | } |
| | | |
| | | return new LocalDate[]{startDate, endDate}; |
| | | return new LocalDate[] { startDate, endDate }; |
| | | } |
| | | |
| | | private QualityQualifiedAnalysisDto buildQualifiedAnalysis(List<QualityInspect> list) { |
| | |
| | | LocalDateTime startTime = today.minusDays(6).atStartOfDay(); |
| | | LocalDateTime endTime = today.atTime(23, 59, 59); |
| | | |
| | | return new LocalDateTime[]{startTime, endTime}; |
| | | return new LocalDateTime[] { startTime, endTime }; |
| | | } |
| | | |
| | | @Override |
| | |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | // ç»è®¡æ¯ç§å¤çç»æçæ°é |
| | | // ç»è®¡æ¯ç§å¤çç»æçæ°é |
| | | Map<String, BigDecimal> countMap = new HashMap<>(); |
| | | for (QualityUnqualified item : list) { |
| | | if (StringUtils.isEmpty(item.getDealResult()) || item.getQuantity() == null) { |
| | |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | // è®¡ç®æ»æ° |
| | | // è®¡ç®æ»æ° |
| | | BigDecimal totalCount = countMap.values() |
| | | .stream() |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | // ææ°éååºæåº |
| | | // ææ°éååºæåº |
| | | List<Map.Entry<String, BigDecimal>> sortedList = countMap.entrySet() |
| | | .stream() |
| | | .sorted((a, b) -> b.getValue().compareTo(a.getValue())) |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public QualityStatisticsDto qualityInspectionStatistics(Integer type) { |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDate startDate; |
| | | LocalDate endDate; |
| | | |
| | | switch (type) { |
| | | case 1: // æ¬å¨ |
| | | startDate = today.with(DayOfWeek.MONDAY); |
| | | endDate = today.with(DayOfWeek.SUNDAY); |
| | | break; |
| | | case 2: // æ¬æ |
| | | startDate = today.with(TemporalAdjusters.firstDayOfMonth()); |
| | | endDate = today.with(TemporalAdjusters.lastDayOfMonth()); |
| | | break; |
| | | case 3: // æ¬å£åº¦ |
| | | int currentMonth = today.getMonthValue(); |
| | | int startMonth = ((currentMonth - 1) / 3) * 3 + 1; |
| | | startDate = LocalDate.of(today.getYear(), startMonth, 1); |
| | | endDate = startDate.plusMonths(2).with(TemporalAdjusters.lastDayOfMonth()); |
| | | break; |
| | | default: |
| | | startDate = today.with(DayOfWeek.MONDAY); |
| | | endDate = today.with(DayOfWeek.SUNDAY); |
| | | } |
| | | |
| | | List<QualityInspect> qualityInspectList = qualityInspectMapper |
| | | .selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .ge(QualityInspect::getCheckTime, startDate) |
| | | .le(QualityInspect::getCheckTime, endDate) |
| | | .eq(QualityInspect::getInspectState, 1)); |
| | | |
| | | QualityStatisticsDto dto = new QualityStatisticsDto(); |
| | | dto.setSupplierNum(sumQuantity(qualityInspectList, 0)); // åææ |
| | | dto.setProcessNum(sumQuantity(qualityInspectList, 1)); // è¿ç¨ |
| | | dto.setFactoryNum(sumQuantity(qualityInspectList, 2)); // åºå |
| | | |
| | | // 4. å¤çå¾è¡¨é¡¹ (Item) |
| | | List<QualityStatisticsItem> itemList = new ArrayList<>(); |
| | | |
| | | Map<QualityInspect, LocalDate> dateMap = qualityInspectList.stream() |
| | | .collect(Collectors.toMap( |
| | | i -> i, |
| | | i -> i.getCheckTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate())); |
| | | if (type == 3) { |
| | | // å£åº¦æ¨¡å¼ï¼ææåç» |
| | | Map<String, List<QualityInspect>> groupByMonth = qualityInspectList.stream() |
| | | .collect(Collectors.groupingBy(i -> { |
| | | LocalDate ld = dateMap.get(i); |
| | | return ld.format(DateTimeFormatter.ofPattern("yyyy-MM")); |
| | | })); |
| | | |
| | | for (int i = 0; i < 3; i++) { |
| | | LocalDate monthDate = startDate.plusMonths(i); |
| | | String monthStr = monthDate.format(DateTimeFormatter.ofPattern("yyyy-MM")); |
| | | itemList.add(buildItem(monthStr, groupByMonth.getOrDefault(monthStr, new ArrayList<>()))); |
| | | } |
| | | } else { |
| | | // å¨æææ¨¡å¼ï¼æå¤©åç» |
| | | Map<String, List<QualityInspect>> groupByDay = qualityInspectList.stream() |
| | | .collect(Collectors.groupingBy(i -> { |
| | | LocalDate ld = dateMap.get(i); |
| | | return ld.format(DateTimeFormatter.ofPattern("MM/dd")); |
| | | })); |
| | | long days = ChronoUnit.DAYS.between(startDate, endDate); |
| | | for (int i = 0; i <= days; i++) { |
| | | LocalDate tempDay = startDate.plusDays(i); |
| | | String dayStr = tempDay.format(DateTimeFormatter.ofPattern("MM/dd")); |
| | | itemList.add(buildItem(dayStr, groupByDay.getOrDefault(dayStr, new ArrayList<>()))); |
| | | } |
| | | } |
| | | |
| | | dto.setItem(itemList); |
| | | return dto; |
| | | } |
| | | |
| | | private BigDecimal sumQuantity(List<QualityInspect> list, Integer type) { |
| | | return list.stream() |
| | | .filter(i -> i.getInspectType().equals(type)) |
| | | .map(QualityInspect::getQuantity) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | |
| | | private QualityStatisticsItem buildItem(String dateLabel, List<QualityInspect> list) { |
| | | QualityStatisticsItem item = new QualityStatisticsItem(); |
| | | item.setDate(dateLabel); |
| | | |
| | | item.setSupplierNum(list.stream().filter(i -> i.getInspectType() == 0).map(QualityInspect::getQuantity) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | item.setProcessNum(list.stream().filter(i -> i.getInspectType() == 1).map(QualityInspect::getQuantity) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | item.setFactoryNum(list.stream().filter(i -> i.getInspectType() == 2).map(QualityInspect::getQuantity) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | |
| | | return item; |
| | | } |
| | | |
| | | @Override |
| | | public List<processDataProductionStatisticsDto> processDataProductionStatistics(Integer type, |
| | | List<Long> processIds) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long userId = SecurityUtils.isAdmin(loginUser.getUserId()) ? null : loginUser.getUserId(); |
| | | |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDate startDate; |
| | | LocalDate endDate; |
| | | |
| | | switch (type) { |
| | | case 1: |
| | | startDate = today; |
| | | endDate = today; |
| | | break; |
| | | case 2: |
| | | startDate = today.with(DayOfWeek.MONDAY); |
| | | endDate = today.with(DayOfWeek.SUNDAY); |
| | | break; |
| | | case 3: |
| | | startDate = today.with(TemporalAdjusters.firstDayOfMonth()); |
| | | endDate = today.with(TemporalAdjusters.lastDayOfMonth()); |
| | | break; |
| | | default: |
| | | startDate = today; |
| | | endDate = today; |
| | | } |
| | | |
| | | LocalDateTime startDateTime = startDate.atStartOfDay(); |
| | | LocalDateTime endDateTime = endDate.atTime(LocalTime.MAX); |
| | | |
| | | return productProcessMapper.calculateProductionStatistics(startDateTime, endDateTime, userId, processIds); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.home.dto.processDataProductionStatisticsDto; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface ProductProcessMapper extends BaseMapper<ProductProcess> { |
| | | IPage<ProductProcessDto> listPage(Page page,@Param("productProcessDto") ProductProcessDto productProcessDto); |
| | | |
| | | List<processDataProductionStatisticsDto> calculateProductionStatistics(LocalDateTime startDateTime, LocalDateTime endDateTime, Long userId, List<Long> processIds); |
| | | } |
| | |
| | | } |
| | | }else { |
| | | //ç´æ¥å
¥åº |
| | | stockUtils.addStock(productProcessRouteItem.getProductModelId(), productionProductOutput.getQuantity(), StockInQualifiedRecordTypeEnum.PRODUCTION_REPORT_STOCK_IN.getCode(), productionProductMain.getId()); |
| | | stockUtils.addStock(productProcessRouteItem.getProductModelId(), productQty, StockInQualifiedRecordTypeEnum.PRODUCTION_REPORT_STOCK_IN.getCode(), productionProductMain.getId()); |
| | | } |
| | | /*æ´æ°å·¥ååç产订å*/ |
| | | ProductWorkOrder productWorkOrder = productWorkOrderMapper.selectById(dto.getWorkOrderId()); |
| | |
| | | ProductOrder productOrder = productOrderMapper.selectById(productWorkOrder.getProductOrderId()); |
| | | if (productOrder != null) { |
| | | BigDecimal orderCompleteQty = productOrder.getCompleteQuantity() == null ? BigDecimal.ZERO : productOrder.getCompleteQuantity(); |
| | | BigDecimal outputQty = productionProductOutput.getQuantity() != null |
| | | ? productionProductOutput.getQuantity() : BigDecimal.ZERO; |
| | | BigDecimal totalQty = productionProductOutput.getQuantity() != null ? productionProductOutput.getQuantity() : BigDecimal.ZERO; |
| | | BigDecimal scrapQty = productionProductOutput.getScrapQty() != null ? productionProductOutput.getScrapQty() : BigDecimal.ZERO; |
| | | |
| | | productOrder.setCompleteQuantity(orderCompleteQty.subtract(outputQty)); |
| | | BigDecimal actualQualifiedQty = totalQty.subtract(scrapQty); |
| | | |
| | | BigDecimal newCompleteQty = orderCompleteQty.subtract(actualQualifiedQty); |
| | | |
| | | productOrder.setCompleteQuantity(newCompleteQty.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : newCompleteQty); |
| | | |
| | | productOrder.setEndTime(null); |
| | | |
| | | productOrderMapper.updateById(productOrder); |
| | | } else { |
| | | throw new ServiceException("å
³èçç产订åä¸åå¨"); |
| | |
| | | /** èåID */
|
| | | private Long menuId;
|
| | |
|
| | | public String getAppComponent() {
|
| | | return appComponent;
|
| | | }
|
| | |
|
| | | public void setAppComponent(String appComponent) {
|
| | | this.appComponent = appComponent;
|
| | | }
|
| | |
|
| | | /** èååç§° */
|
| | | private String menuName;
|
| | |
|
| | |
| | |
|
| | | /** ç»ä»¶è·¯å¾ */
|
| | | private String component;
|
| | |
|
| | | /** APPç»ä»¶è·¯å¾ */
|
| | | private String appComponent;
|
| | |
|
| | | /** è·¯ç±åæ° */
|
| | | private String query;
|
| | |
| | | .append("isFrame", getIsFrame())
|
| | | .append("IsCache", getIsCache())
|
| | | .append("menuType", getMenuType())
|
| | | .append("appComponent", getAppComponent())
|
| | | .append("visible", getVisible())
|
| | | .append("status ", getStatus())
|
| | | .append("perms", getPerms())
|
| | |
| | | private Long supplierId; |
| | | |
| | | /** |
| | | * ä¾åºååç±» |
| | | */ |
| | | @Excel(name = "ä¾åºååç±»") |
| | | @TableField(exist = false) |
| | | private String supplierType; |
| | | |
| | | /** |
| | | * ä¾åºååç§° |
| | | */ |
| | | @Excel(name = "ä¾åºååç§°") |
| | |
| | | IPage<SalesLedgerProductDto> salesLedgerProductDtoIPage = salesLedgerProductMapper.listPagePurchaseLedger(page, salesLedgerProduct); |
| | | salesLedgerProductDtoIPage.getRecords().forEach(item -> { |
| | | // å¤æç¶æ |
| | | if(item.getTaxInclusiveTotalPrice().compareTo(item.getInvoiceTotal()) == 0){ |
| | | if(item.getTaxInclusiveTotalPrice().compareTo(item.getTicketsTotal()) == 0){ |
| | | item.setStatusName("已宿仿¬¾"); |
| | | }else{ |
| | | item.setStatusName("æªå®æä»æ¬¾"); |
| | |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: DEV |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://localhost:3306/product-inventory-management-new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://localhost:3306/product-inventory-management-pcdz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # ä»åºæ°æ®æº |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: /javaWork/product-inventory-management/file |
| | | |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: PCDZ |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 9003 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: warn |
| | | org.springframework: warn |
| | | |
| | | minio: |
| | | endpoint: http://114.132.189.42/ |
| | | port: 7019 |
| | | secure: false |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: jxc |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:3306/product-inventory-management-new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: xd@123456.. |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 1GB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 2GB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: false |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | # host: 127.0.0.1 |
| | | host: 172.17.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | # password: root2022! |
| | | password: |
| | | |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # Quartz宿¶ä»»å¡é
ç½®ï¼æ°å¢é¨åï¼ |
| | | quartz: |
| | | job-store-type: jdbc # ä½¿ç¨æ°æ®åºåå¨ |
| | | jdbc: |
| | | initialize-schema: never # 馿¬¡è¿è¡æ¶èªå¨åå»ºè¡¨ç»æï¼æååæ¹ä¸ºnever |
| | | schema: classpath:org/quartz/impl/jdbcjobstore/tables_mysql_innodb.sql # MySQLè¡¨ç»æèæ¬ |
| | | properties: |
| | | org: |
| | | quartz: |
| | | scheduler: |
| | | instanceName: RuoYiScheduler |
| | | instanceId: AUTO |
| | | jobStore: |
| | | class: org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # MySQLéé
|
| | | tablePrefix: qrtz_ # 表ååç¼ï¼ä¸èæ¬ä¸è´ |
| | | isClustered: false # åèç¹æ¨¡å¼ï¼éç¾¤éæ¹ä¸ºtrueï¼ |
| | | clusterCheckinInterval: 10000 |
| | | txIsolationLevelSerializable: true |
| | | threadPool: |
| | | class: org.quartz.simpl.SimpleThreadPool |
| | | threadCount: 10 # çº¿ç¨æ± å¤§å° |
| | | threadPriority: 5 |
| | | makeThreadsDaemons: true |
| | | updateCheck: false # å
³éçæ¬æ£æ¥ |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 450 |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | | typeAliasesPackage: com.ruoyi.**.pojo |
| | | # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶ |
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶ |
| | | configLocation: classpath:mybatis/mybatis-config.xml |
| | | global-config: |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: true |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | # 代ç çæ |
| | | gen: |
| | | # ä½è
|
| | | author: ruoyi |
| | | # é»è®¤çæå
è·¯å¾ system éæ¹æèªå·±ç模ååç§° å¦ system monitor tool |
| | | packageName: com.ruoyi.project.system |
| | | # èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯true |
| | | autoRemovePre: false |
| | | # 表åç¼ï¼çæç±»åä¸ä¼å
å«è¡¨åç¼ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | tablePrefix: sys_ |
| | | # æ¯å¦å
è®¸çææä»¶è¦çå°æ¬å°ï¼èªå®ä¹è·¯å¾ï¼ï¼é»è®¤ä¸å
许 |
| | | allowOverwrite: false |
| | | |
| | | file: |
| | | temp-dir: /javaWork/product-inventory-management/file/temp/uploads |
| | | upload-dir: /javaWork/product-inventory-management/file/prod/uploads |
| | |
| | | SELECT |
| | | T1.id, |
| | | T1.supplier_name, |
| | | T1.supplier_type, |
| | | T1.taxpayer_identification_num, |
| | | T1.company_address, |
| | | T1.company_phone, |
| | |
| | | </where> |
| | | order by p.id asc |
| | | </select> |
| | | |
| | | <select id="calculateProductionStatistics" resultType="com.ruoyi.home.dto.processDataProductionStatisticsDto"> |
| | | SELECT |
| | | pp.name AS processName, |
| | | SUM((ppo.quantity + ppo.scrap_qty) * pp.salary_quota) AS totalInput, |
| | | SUM(ppo.scrap_qty * pp.salary_quota) AS totalScrap, |
| | | SUM(ppo.quantity * pp.salary_quota) AS totalOutput |
| | | FROM |
| | | production_product_output ppo |
| | | INNER JOIN production_product_main ppm ON ppo.product_main_id = ppm.id |
| | | INNER JOIN product_process_route_item ppri ON ppm.product_process_route_item_id = ppri.id |
| | | INNER JOIN product_process pp ON ppri.process_id = pp.id |
| | | <where> |
| | | <if test="startDateTime != null"> |
| | | AND ppo.create_time >= #{startDateTime} |
| | | </if> |
| | | <if test="endDateTime != null"> |
| | | AND ppo.create_time <= #{endDateTime} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND ppm.user_id = #{userId} |
| | | </if> |
| | | <if test="processIds != null and processIds.size() > 0"> |
| | | AND pp.id IN |
| | | <foreach collection="processIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | pp.id, |
| | | pp.name |
| | | </select> |
| | | </mapper> |
| | |
| | | pl.template_name, |
| | | pl.approve_user_ids, |
| | | sm.is_white, |
| | | sm.supplier_type, |
| | | pl.approval_status, |
| | | pl.payment_method, |
| | | pl.remarks |
| | |
| | | <if test="c.entryDateEnd != null and c.entryDateEnd != '' "> |
| | | AND pl.entry_date <= DATE_FORMAT(#{c.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | <if test="c.supplierType != null and c.supplierType != '' "> |
| | | AND sm.supplier_type = #{c.supplierType} |
| | | </if> |
| | | </where> |
| | | group by pl.id, pl.purchase_contract_number, pl.sales_contract_no, pl.supplier_name, |
| | | pl.project_name,pl.entry_date, |
| | |
| | | |
| | | <select id="invoiceRegistrationProductPage" resultType="com.ruoyi.sales.dto.InvoiceRegistrationProductDto"> |
| | | SELECT |
| | | T1.id , |
| | | T1.sales_ledger_id , |
| | | T1.sales_ledger_product_id , |
| | | T1.invoice_registration_id , |
| | | T1.product_category , |
| | | T1.specification_model , |
| | | T1.unit , |
| | | T1.quantity , |
| | | T1.tax_rate , |
| | | T1.tax_inclusive_unit_price , |
| | | T1.tax_inclusive_total_price , |
| | | T1.tax_exclusive_total_price , |
| | | T1.invoice_type , |
| | | T1.invoice_num , |
| | | T1.invoice_amount , |
| | | T1.no_invoice_num , |
| | | T1.no_invoice_amount , |
| | | T1.create_time , |
| | | T1.create_user , |
| | | T1.update_time , |
| | | T1.update_user , |
| | | T1.tenant_id, |
| | | T2.sales_contract_no, |
| | | T2.customer_contract_no, |
| | | T2.customer_name, |
| | | T3.invoice_no, |
| | | T3.id as invoice_ledger_id, |
| | | IFNULL(T3.invoice_total,0) AS invoice_total, |
| | | T3.invoice_person, |
| | | T3.invoice_date, |
| | | T4.invoiceFileName, |
| | | T2.project_name |
| | | T1.id , |
| | | T1.sales_ledger_id , |
| | | T1.sales_ledger_product_id , |
| | | T1.invoice_registration_id , |
| | | T1.product_category , |
| | | T1.specification_model , |
| | | T1.unit , |
| | | T1.quantity , |
| | | T1.tax_rate , |
| | | T1.tax_inclusive_unit_price , |
| | | T1.tax_inclusive_total_price , |
| | | T1.tax_exclusive_total_price , |
| | | T1.invoice_type , |
| | | T1.invoice_num , |
| | | T1.invoice_amount , |
| | | T1.no_invoice_num , |
| | | T1.no_invoice_amount , |
| | | T1.create_time , |
| | | T1.create_user , |
| | | T1.update_time , |
| | | T1.update_user , |
| | | T1.tenant_id, |
| | | T2.sales_contract_no, |
| | | T2.customer_contract_no, |
| | | T2.customer_name, |
| | | T3.invoice_no, |
| | | T3.id as invoice_ledger_id, |
| | | IFNULL(T3.invoice_total,0) AS invoice_total, |
| | | T3.invoice_person, |
| | | T3.invoice_date, |
| | | T4.invoiceFileName, |
| | | T2.project_name, |
| | | u.nick_name as invoicePerson |
| | | FROM invoice_registration_product T1 |
| | | LEFT JOIN sales_ledger T2 ON T1.sales_ledger_id = T2.id |
| | | LEFT JOIN sys_user u ON u.user_id = T1.create_user |
| | | RIGHT JOIN invoice_ledger T3 ON T1.id = T3.invoice_registration_product_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | invoice_ledger_id, |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | SELECT |
| | | invoice_ledger_id, |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T3.id |
| | | <where> |
| | | <if test="invoiceRegistrationProductDto.searchText != null and invoiceRegistrationProductDto.searchText != '' "> |
| | | AND (T2.sales_contract_no LIKE CONCAT('%',#{invoiceRegistrationProductDto.searchText},'%') |
| | | OR |
| | | T2.customer_name LIKE CONCAT('%',#{invoiceRegistrationProductDto.searchText},'%') |
| | | ) |
| | | OR |
| | | T2.customer_name LIKE CONCAT('%',#{invoiceRegistrationProductDto.searchText},'%') |
| | | ) |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.invoiceDateStart != null and invoiceRegistrationProductDto.invoiceDateStart != ''"> |
| | | AND T3.invoice_date >= str_to_date(#{invoiceRegistrationProductDto.invoiceDateStart}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.invoiceDateEnd != null and invoiceRegistrationProductDto.invoiceDateEnd != ''"> |
| | | AND T3.invoice_date < date_add(str_to_date(#{invoiceRegistrationProductDto.invoiceDateEnd}, '%Y-%m-%d'), interval 1 day) |
| | | AND T3.invoice_date < date_add(str_to_date(#{invoiceRegistrationProductDto.invoiceDateEnd}, |
| | | '%Y-%m-%d'), interval 1 day) |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.createTimeStart != null "> |
| | | AND T1.create_time >= date_format(#{invoiceRegistrationProductDto.createTimeStart}, '%Y-%m-%d %H:%i:%s') |
| | | AND T1.create_time >= date_format(#{invoiceRegistrationProductDto.createTimeStart}, '%Y-%m-%d |
| | | %H:%i:%s') |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.createTimeEnd != null "> |
| | | AND T1.create_time <= date_format(#{invoiceRegistrationProductDto.createTimeStart}, '%Y-%m-%d %H:%i:%s')+interval 1 day |
| | | AND T1.create_time <= date_format(#{invoiceRegistrationProductDto.createTimeStart}, '%Y-%m-%d |
| | | %H:%i:%s')+interval 1 day |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.create_time DESC |
| | |
| | | <result property="parentId" column="parent_id" /> |
| | | <result property="orderNum" column="order_num" /> |
| | | <result property="path" column="path" /> |
| | | <result property="appComponent" column="app_component" /> |
| | | <result property="component" column="component" /> |
| | | <result property="query" column="query" /> |
| | | <result property="routeName" column="route_name" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectMenuVo"> |
| | | select menu_id, menu_name, parent_id, order_num, path, component, `query`, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time |
| | | select menu_id, menu_name, parent_id, order_num, path,app_component, component, `query`, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time |
| | | from sys_menu |
| | | </sql> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectMenuTreeAll" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path,m.app_component, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectMenuListByUserId" parameterType="com.ruoyi.project.system.domain.SysMenu" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path,m.app_component, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | |
| | | </select> |
| | | |
| | | <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path,m.app_component, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | |
| | | <if test="orderNum != null">order_num = #{orderNum},</if> |
| | | <if test="path != null and path != ''">path = #{path},</if> |
| | | <if test="component != null">component = #{component},</if> |
| | | <if test="appComponent != null">app_component = #{appComponent},</if> |
| | | <if test="query != null">`query` = #{query},</if> |
| | | <if test="routeName != null">route_name = #{routeName},</if> |
| | | <if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if> |
| | |
| | | <if test="menuName != null and menuName != ''">menu_name,</if> |
| | | <if test="orderNum != null">order_num,</if> |
| | | <if test="path != null and path != ''">path,</if> |
| | | <if test="appComponent != null and appComponent != ''">app_component,</if> |
| | | <if test="component != null and component != ''">component,</if> |
| | | <if test="query != null and query != ''">`query`,</if> |
| | | <if test="routeName != null">route_name,</if> |
| | |
| | | <if test="menuName != null and menuName != ''">#{menuName},</if> |
| | | <if test="orderNum != null">#{orderNum},</if> |
| | | <if test="path != null and path != ''">#{path},</if> |
| | | <if test="appComponent != null and appComponent != ''">#{appComponent},</if> |
| | | <if test="component != null and component != ''">#{component},</if> |
| | | <if test="query != null and query != ''">#{query},</if> |
| | | <if test="routeName != null">#{routeName},</if> |