当前位置: 首页 > news >正文

c# 动态lambda实现二级过滤(多种参数类型)

效果

调用方法

实体类(可以根据需求更换)

public class ToolStr50
{public bool isSelected { get; set; }public string toolStr1 { get; set; }public string toolStr2 { get; set; }public string toolStr3 { get; set; }public string toolStr4 { get; set; }public string toolStr5 { get; set; }public string toolStr6 { get; set; }public string toolStr7 { get; set; }public string toolStr8 { get; set; }public string toolStr9 { get; set; }public string toolStr10 { get; set; }public int toolInt1 { get; set; }public int toolInt2 { get; set; }public int toolInt3 { get; set; }public int toolInt4 { get; set; }public int toolInt5 { get; set; }public int toolInt6 { get; set; }public int toolInt7 { get; set; }public int toolInt8 { get; set; }public int toolInt9 { get; set; }public int toolInt10 { get; set; }public double toolDouble1 { get; set; }public double toolDouble2 { get; set; }public double toolDouble3 { get; set; }public double toolDouble4 { get; set; }public double toolDouble5 { get; set; }public double toolDouble6 { get; set; }public double toolDouble7 { get; set; }public double toolDouble8 { get; set; }public double toolDouble9 { get; set; }public double toolDouble10 { get; set; }public DateTime toolDate1 { get; set; }public DateTime toolDate2 { get; set; }public DateTime toolDate3 { get; set; }public DateTime toolDate4 { get; set; }public DateTime toolDate5 { get; set; }public DateTime toolDate6 { get; set; }public DateTime toolDate7 { get; set; }public DateTime toolDate8 { get; set; }public DateTime toolDate9 { get; set; }public DateTime toolDate10 { get; set; }
}

传入需要二级过滤的数据

 public void ShowSecondaryFiltration(){var columnMappings = new Dictionary<string, string>{{ "采购日期", "toolStr26" },{ "采购周期", "toolInt10" },{ "采购回复交期", "toolStr31" },{ "采购说明", "toolStr53" },{ "生产订单号", "toolStr1" },{ "来源单号", "toolStr2" },{ "采购订单号", "toolStr3" },{ "行号", "toolInt1" },{ "料号", "toolStr4" },{ "品名", "toolStr5" },{ "规格描述", "toolStr6" },{ "现存量", "toolInt2" },{ "单位", "toolStr11" },{ "采购数量(计量)", "toolInt3" },{ "收货数量(计量)", "toolInt4" },{ "已退货数(计量)", "toolInt5" },{ "实际入库数(计量)", "toolInt6" },{ "入库单号", "toolStr16" },{ "已暂收数量(计量)", "toolInt7" },{ "最后交货日期", "toolStr18" },{ "逾期天数(负数未到期)", "toolInt8" },{ "品质异常报告日期", "toolStr19" },{ "品质问题描述", "toolStr20" },{ "处理结论", "toolStr21" },{ "未交数量(计量)", "toolInt9" },{ "交货结案日期", "toolStr23" },{ "请购日期", "toolStr24" },{ "PMC交单日期", "toolStr25" },{ "理论交期", "toolStr28" },{ "要求交期", "toolStr29" },{ "订单回传日期", "toolStr30" },{ "色板_模板_图纸提供情况", "toolStr32" },{ "异常反馈", "toolStr33" },{ "预付款比例", "toolInt11" },{ "预付款支付日期", "toolStr35" },{ "尾款比例", "toolInt12" },{ "尾款支付日期", "toolStr39" },{ "采购员", "toolStr44" },{ "请购制单人", "toolStr40" },{ "供应商名称", "toolStr46" },{ "请购单备注", "toolStr42" },{ "采购单备注", "toolStr45" },{ "可用量", "toolStr8" },{ "含税单价", "toolDouble1" },{ "含税金额", "toolDouble2" },{ "采购到货日期", "toolStr37" },{ "财务交单日期", "toolStr38" },{ "请购人", "toolStr41" },{ "采购制单人", "toolStr43" },{ "采购订单结案状态", "toolStr48" },{ "修改日期_请购", "toolStr50" },{ "修改日期_采购", "toolStr51" },{ "PMC要求交货日期", "toolStr52" }};var traceWindow = new TraceTableSecondaryFiltration(columnMappings, OdlIbo);traceWindow.QueryConditions = _queryConditions;if (traceWindow.ShowDialog() == true) // 检查对话框的结果{var filteredIbo = traceWindow.FilteredData;_queryConditions = traceWindow.QueryConditions;Ibo = filteredIbo;// 使用 filteredIbo 进行后续处理}if (_queryConditions.Count == 0){SelectInfo();}//更新总条数和总金额InfoCount = "数据汇总:" + Ibo.Count.ToString() + "条";decimal total = Ibo.Sum(x => Convert.ToDecimal(x.toolStr10)); // 假设 TaxInclusiveSum 是 double 类型  total = decimal.Round(total, 4);//TaxinclusiveSum = "合计含税金额:" + total.ToString();}

窗体页面TraceTableSecondaryFiltration.xaml

<Window x:Class="GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow.TraceTableSecondaryFiltration"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow"mc:Ignorable="d"Title="TraceTableSecondaryFiltration" Height="450" Width="800"WindowStartupLocation="CenterScreen"><Grid Margin="10" Name="myDynamicGrid"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="*"/><!-- 让表格占用剩余空间 --></Grid.RowDefinitions><TextBlock Text="字段名称" Margin="49,34,655,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="FieldNameComboBox" Margin="25,5,640,0" VerticalAlignment="Top" ItemsSource="{Binding FieldNames}" SelectedItem="{Binding SelectedFieldName, Mode=TwoWay}" SelectionChanged="FieldNameComboBox_SelectionChanged"Grid.Row="1"/><TextBlock Text="条件" Margin="227,34,495,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="ConditionComboBox" Margin="184,5,471,0" VerticalAlignment="Top" ItemsSource="{Binding Conditions}" SelectedItem="{Binding SelectedCondition}" Grid.Row="1"/><TextBlock Text="条件值" Margin="402,34,320,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="ValueComboBox" Margin="357,5,275,0" VerticalAlignment="Top" ItemsSource="{Binding ConditionValues}" SelectedItem="{Binding SelectedConditionValue}" Grid.Row="1"/><TextBlock Text="关系" Margin="564,34,168,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="RelationComboBox" Margin="532,5,154,0" VerticalAlignment="Top" ItemsSource="{Binding RelationValues}" SelectedItem="{Binding SelectedRelationValue}" Grid.Row="1"/><Button Content="添加" Command="{Binding AddQueryConditionCommand}" Margin="637,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="27" Grid.Row="1"/><Button Content="查询" Command="{Binding QueryCommand}" Margin="697,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="27" Grid.Row="1"/><DataGrid Name="ConditionDataGrid" Grid.Row="2" Margin="10,10,10,0" BorderThickness="1"Height="300"AutoGenerateColumns="False" ItemsSource="{Binding QueryConditions}"><DataGrid.Columns><DataGridTextColumn Width="200" Header="字段名称" Binding="{Binding FieldName}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="100" Header="条件" Binding="{Binding Condition}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="200" Header="条件值" Binding="{Binding ConditionValue}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="100" Header="关系" Binding="{Binding RelationValue}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTemplateColumn Width="200" Header="操作"><DataGridTemplateColumn.CellTemplate><DataTemplate><Button Content="删除" Width="80" Command="{Binding DataContext.DeleteConditionCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"CommandParameter="{Binding}"/></DataTemplate></DataGridTemplateColumn.CellTemplate><DataGridTemplateColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTemplateColumn.HeaderStyle></DataGridTemplateColumn></DataGrid.Columns></DataGrid></Grid>
</Window>

窗体实现类TraceTableSecondaryFiltration.xaml.cs

这里在进行数据对比时对数据进行了类型转换,因为string类型的对比会出现

“4”>“20”的情况

using CommunityToolkit.Mvvm.Input;
using SQLSugarDB.Model.Public;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Expression = System.Linq.Expressions.Expression;
namespace GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow
{public partial class TraceTableSecondaryFiltration : Window{public List<ToolStr50> FilteredData { get; private set; }private Dictionary<string, string> _columnMappings;//所有的列和对应Toolstr属性的映射关系private List<ToolStr50> _Ibo;//所有的数据private List<string> _fieldNames = new List<string>(); // 字段名public List<string> FieldNames{get { return _fieldNames; }set{_fieldNames = value;}}private string _selectedFieldName;public string SelectedFieldName{get { return _selectedFieldName; }set{_selectedFieldName = value;}}private ObservableCollection<string> _conditions = new ObservableCollection<string>(); // 条件public ObservableCollection<string> Conditions{get { return _conditions; }set{_conditions = value;}}private string _selectedCondition;public string SelectedCondition{get { return _selectedCondition; }set{_selectedCondition = value;}}private ObservableCollection<string> _conditionValues = new ObservableCollection<string>(); // 条件值public ObservableCollection<string> ConditionValues{get { return _conditionValues; }set{_conditions = value;}}private string _selectedConditionValue;public string SelectedConditionValue{get { return _selectedConditionValue; }set{_selectedConditionValue = value;}}private ObservableCollection<string> _relationValues = new ObservableCollection<string>(); // 关系public ObservableCollection<string> RelationValues{get { return _relationValues; }set{_relationValues = value;}}private string _selectedRelationValue;public string SelectedRelationValue{get { return _selectedRelationValue; }set{_selectedRelationValue = value;}}private ObservableCollection<SecondQueryCondition> _queryConditions = new ObservableCollection<SecondQueryCondition>();public ObservableCollection<SecondQueryCondition> QueryConditions{get => _queryConditions;set{_queryConditions = value;}}public TraceTableSecondaryFiltration(Dictionary<string, string> columnMappings, List<ToolStr50> Ibo){_columnMappings = columnMappings;_Ibo = Ibo;InitializeComponent();DataContext = this; // 设置数据上下文为当前窗口//将columnMappings所有的key拿出来放进List<string> _fieldNames中_fieldNames = new List<string>(_columnMappings.Keys);Conditions.Add("大于");Conditions.Add("大于等于");Conditions.Add("小于");Conditions.Add("小于等于");Conditions.Add("等于");Conditions.Add("不等于");RelationValues.Add("并且");RelationValues.Add("或者");//设定个默认值SelectedRelationValue = "并且";}[RelayCommand]public void AddQueryCondition(){// 检查是否有空值或空字符串if (string.IsNullOrEmpty(_selectedFieldName) ||string.IsNullOrEmpty(_selectedCondition) ||string.IsNullOrEmpty(_selectedConditionValue) ||string.IsNullOrEmpty(_selectedRelationValue)){return; // 如果有空值,直接返回}// 创建并添加 SecondQueryCondition 对象到 QueryConditions 列表QueryConditions.Add(new SecondQueryCondition(QueryConditions.Count + 1, _selectedFieldName, _selectedCondition, _selectedConditionValue, _selectedRelationValue));}private void FieldNameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e){ConditionValues.Clear();_columnMappings.TryGetValue(_selectedFieldName, out string property);if (_Ibo == null){return;}foreach (var item in _Ibo){string propertyValue = item.GetType().GetProperty(property)?.GetValue(item)?.ToString();if (!string.IsNullOrEmpty(propertyValue) && !ConditionValues.Contains(propertyValue)){ConditionValues.Add(propertyValue);}}}[RelayCommand]public void DeleteCondition(SecondQueryCondition secondQueryCondition){QueryConditions.Remove(secondQueryCondition);}[RelayCommand]public void Query(){var parameter = Expression.Parameter(typeof(ToolStr50), "p");Expression finalExpression = null;foreach (var queryCondition in QueryConditions){if (_columnMappings.TryGetValue(queryCondition.FieldName, out string property)){var member = Expression.Property(parameter, property);var conditionValue = Expression.Constant(queryCondition.ConditionValue, typeof(string));Expression comparison;// 尝试解析为 int, double, DateTimeif (int.TryParse(queryCondition.ConditionValue, out int intValue)){var intMember = Expression.Convert(member, typeof(int));var intConditionValue = Expression.Constant(intValue, typeof(int));comparison = GetIntegerComparison(queryCondition.Condition, intMember, intConditionValue);}else if (double.TryParse(queryCondition.ConditionValue, out double doubleValue)){var doubleMember = Expression.Convert(member, typeof(double));var doubleConditionValue = Expression.Constant(doubleValue, typeof(double));comparison = GetDoubleComparison(queryCondition.Condition, doubleMember, doubleConditionValue);}//如果日期类型无法对比直接注释掉,按照string类型对比//else if (DateTime.TryParse(queryCondition.ConditionValue, out DateTime dateTimeValue))//{//    var dateTimeMember = Expression.Convert(member, typeof(DateTime));//    var dateTimeConditionValue = Expression.Constant(dateTimeValue, typeof(DateTime));//    comparison = GetDateTimeComparison(queryCondition.Condition, dateTimeMember, dateTimeConditionValue);//}else{// 如果无法转换,继续使用字符串比较comparison = GetStringComparison(queryCondition.Condition, member, conditionValue);}// 组合条件if (finalExpression == null){finalExpression = comparison;}else{if (queryCondition.RelationValue.Equals("并且")){finalExpression = Expression.AndAlso(finalExpression, comparison); // 使用 AndAlso 组合条件}if (queryCondition.RelationValue.Equals("或者")){finalExpression = Expression.Or(finalExpression, comparison); // 使用 Or 组合条件}}}}// 生成最终的 Lambda 表达式if (finalExpression != null){var lambda = Expression.Lambda<Func<ToolStr50, bool>>(finalExpression, parameter);FilteredData = _Ibo.Where(lambda.Compile()).ToList();this.DialogResult = true; // 可选: 设置窗口的结果this.Close(); // 关闭窗口}else //没有查询条件查全部{FilteredData = _Ibo;this.DialogResult = true; // 可选: 设置窗口的结果this.Close(); // 关闭窗口}}private Expression GetIntegerComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetDoubleComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetDateTimeComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetStringComparison(string condition, Expression member, Expression conditionValue){// 比较两个字符串时,我们需要使用 string.Compare 方法var compareMethod = typeof(string).GetMethod("Compare", new[] { typeof(string), typeof(string) });return condition switch{// 等于"等于" => Expression.Equal(member, conditionValue),// 不等于"不等于" => Expression.NotEqual(member, conditionValue),// 大于"大于" => Expression.GreaterThan(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 小于"小于" => Expression.LessThan(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 大于等于"大于等于" => Expression.GreaterThanOrEqual(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 小于等于"小于等于" => Expression.LessThanOrEqual(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}}
}

动态生成的lambda表达式:

相关文章:

c# 动态lambda实现二级过滤(多种参数类型)

效果 调用方法 实体类&#xff08;可以根据需求更换&#xff09; public class ToolStr50 {public bool isSelected { get; set; }public string toolStr1 { get; set; }public string toolStr2 { get; set; }public string toolStr3 { get; set; }public string toolStr4 { …...

34.Redis事务

1.事务Redis介绍 事务表示一组动作&#xff0c;要么全部执行&#xff0c;要么全部不执行。 例如微博粉丝关注用户&#xff0c;博主粉丝列表增加了用户&#xff0c;粉丝关注列表增加了博主&#xff1b; Redis 提供了简单的事务功能&#xff0c;将一组需要一起执行的命令放到mult…...

认识类和对象

认识类 类是用来对一个实体 ( 对象 ) 来进行描述的&#xff0c;主要描述该实体(对象)具有哪些属性(外观尺寸等)&#xff0c;哪些功能(用来干啥) 类中包含的内容称为 类的成员。属性主要是用来描述类的&#xff0c;称之为 类的成员属性或者 类成员变量。方法主要说明类具有哪些功…...

解决echarts桑基图为0时tooltip不显示的问题

关键代码 formatter: function (params) {console.log("params",params)if (params.value 0) {// 如果值为0&#xff0c;返回空字符串&#xff0c;不显示任何内容return params.name : params.value;// return ;} else {// 否则返回标准的格式化信息return par…...

vue3 基础笔记

基础模板语法 //1. 普通文本插值: <p>{{ rawHtml }}</p>//2. v-html 指令&#xff1a;插入 HTML 内容&#xff0c;并希望 Vue 将其视为 HTML 而不是纯文本 <p v-html"rawHtml"></p> let rawHtml <span>这是一个 <b>HTML</…...

Oracle 第30章:最佳实践与案例研究

在《Oracle最佳实践与案例研究》第30章中&#xff0c;我们探讨了实际项目中的经验分享以及解决常见问题的技巧。这一章节旨在通过具体的案例来说明如何在Oracle数据库管理和开发中应用最佳实践。下面我将从几个方面进行详细介绍&#xff0c;并提供一些源代码示例。 1. 性能优化…...

第九周预习报告

文章目录 第九周预习报告学习内容AI 对学习内容的总结章节概述内容总结 对知识总结的反思思维导图基于AI的学习知识点1&#xff1a;系统调用知识点2&#xff1a;进程控制 学习实践过程遇到的问题与解决方式问题1&#xff1a;fork() 调用后&#xff0c;子进程和父进程同时运行导…...

【分享】这篇教程助力你成为 JavaScript 糕手!(四)

第四章&#xff1a;运算符与表达式 4.1 算术运算符 加法运算符&#xff08;&#xff09;&#xff1a;用于数字相加&#xff0c;如console.log(5 3);结果为8。 当用于字符串时&#xff0c;它表示字符串拼接。例如console.log(‘Hello’ ‘world’);输出Hello world。如果一个操…...

双亲委派模型的破坏

双亲委派模型的第一次“被破坏”其实发生在双亲委派模型出现之前--即JDK1.2发布之前。由于双亲委派模型是在JDK1.2之后才被引入的,而类加载器和抽象类java.lang.ClassLoader则是JDK1.0时候就已经存在,面对已经存在 的用户自定义类加载器的实现代码,Java设计者引入双亲委派模…...

Android关机流程知多少?

在 Android 中&#xff0c;关机流程涉及系统各个组件的协同工作&#xff0c;确保设备在断电之前能够安全地关闭所有活动并保存数据。以下是 Android 系统中关机流程的详细介绍&#xff1a; 1. 用户触发关机请求 关机流程由用户的操作触发&#xff0c;通常有以下几种方式&#…...

深入理解指针end(总结篇)

如果有不会的智识点&#xff0c;请移动到博主前四篇指针博客&#xff01; 可以当一个指针智商检阅博客看。 看看你是否掌握了这些知识 1&#xff1a;内存&#xff0c;指针变量 内存单元的编号地址指针&#xff1b; 指针变量和其他变量没有区别&#xff0c;指针变量是来存放…...

C# 程序暂停的两种方式

C# 程序暂停的两种方式&#xff1a;EventWaitHandle 与 volatile bool pause 在C#中&#xff0c;线程控制是多线程编程的重要组成部分&#xff0c;其中实现暂停的需求经常出现。本文将详细探讨使用EventWaitHandle和设置volatilebool来实现线程暂停的不同方式&#xff0c;它们…...

【LeetCode】【算法】160.相交链表

Leetcode 160. 相交链表 题目描述 给你两个单链表的头节点 headA 和 headB &#xff0c;请你找出并返回两个单链表相交的起始节点。如果两个链表不存在相交节点&#xff0c;返回 null 。 思路 AB&#xff0c;一个指针&#xff0c;访问完A访问B&#xff1b;另一个指针&#…...

光伏破局 引领能源革命

为进一步推进商业信用体系建设&#xff0c;促进企业诚实守信经营&#xff0c;面向企业普及诚信与品牌建设的意义&#xff0c;指导企业加强诚信品牌建设&#xff0c;提升其整体竞争力&#xff0c;“崛起的民族品牌”专题系列节目以诚信为内涵&#xff0c;在全国范围内遴选出有行…...

Jenkins声明式Pipeline流水线语法示例

系列文章目录 docker搭建Jenkins2.346.3版本及常用工具集成配置(ldap、maven、ansible、npm等) docker安装低版本的jenkins-2.346.3,在线安装对应版本插件失败的解决方法 文章目录 系列文章目录jenkins流水线基础1、pipeline1.1、什么是pipeline&#xff1f;1.2、为什么使用pi…...

互联网技术净土?原生鸿蒙开启全新技术征程

鸿蒙生态与开发者的崭新机会 HarmonyOS NEXT承载着华为对未来操作系统的深刻理解&#xff0c;如今已发展为坚实的数字底座。它不仅在技术层面取得了全面突破&#xff0c;还在中国操作系统市场中站稳了脚跟。 当前&#xff0c;HarmonyOS NEXT的代码行数已超过1.1亿&#xff0c…...

关于Django 模型字段 `choices`自定义数据类型的枚举——补充

文章目录 1. 处理 datetime 类型的 choices2. 处理 time 类型的 choices3. 处理 Decimal 类型的 choices4. 处理 UUID 类型的 choices5. 处理 float 类型的 choices 在 Choices 类的基础上扩展&#xff0c;可以将 choices 与特定数据类型&#xff08;如 date 或 datetime&a…...

CAP理论的延申--BASE理论

上一篇文章我简单介绍了一下什么是CAP理论&#xff0c;本篇文章讲解一下随着技术的演变&#xff0c;CAP理论是如何发展为BASE理论的。 CAP理论回顾 首先我们回顾一下CAP理论&#xff0c;CAP理论指得是分布式系统发生网络等故障时&#xff0c;不同节点之间无法同步数据&#xf…...

【傻呱呱】phpMyAdmin怎样给特定用户授权特定数据库权限?

前期准备 phpMyAdmin数据库&#xff08;MySQL&#xff09; END...

『VUE』21. 组件注册(详细图文注释)

目录 组件注册局部注册全局注册全局注册示例总结 欢迎关注 『VUE』 专栏&#xff0c;持续更新中 欢迎关注 『VUE』 专栏&#xff0c;持续更新中 组件注册 组件注册有两种方式&#xff1a;全局注册和局部注册。全局注册只需要注册依次,其他组件可以直接调用无需再次像局部注册一…...

【Oracle APEX开发小技巧12】

有如下需求&#xff1a; 有一个问题反馈页面&#xff0c;要实现在apex页面展示能直观看到反馈时间超过7天未处理的数据&#xff0c;方便管理员及时处理反馈。 我的方法&#xff1a;直接将逻辑写在SQL中&#xff0c;这样可以直接在页面展示 完整代码&#xff1a; SELECTSF.FE…...

2025年能源电力系统与流体力学国际会议 (EPSFD 2025)

2025年能源电力系统与流体力学国际会议&#xff08;EPSFD 2025&#xff09;将于本年度在美丽的杭州盛大召开。作为全球能源、电力系统以及流体力学领域的顶级盛会&#xff0c;EPSFD 2025旨在为来自世界各地的科学家、工程师和研究人员提供一个展示最新研究成果、分享实践经验及…...

线程同步:确保多线程程序的安全与高效!

全文目录&#xff1a; 开篇语前序前言第一部分&#xff1a;线程同步的概念与问题1.1 线程同步的概念1.2 线程同步的问题1.3 线程同步的解决方案 第二部分&#xff1a;synchronized关键字的使用2.1 使用 synchronized修饰方法2.2 使用 synchronized修饰代码块 第三部分&#xff…...

django filter 统计数量 按属性去重

在Django中&#xff0c;如果你想要根据某个属性对查询集进行去重并统计数量&#xff0c;你可以使用values()方法配合annotate()方法来实现。这里有两种常见的方法来完成这个需求&#xff1a; 方法1&#xff1a;使用annotate()和Count 假设你有一个模型Item&#xff0c;并且你想…...

【项目实战】通过多模态+LangGraph实现PPT生成助手

PPT自动生成系统 基于LangGraph的PPT自动生成系统&#xff0c;可以将Markdown文档自动转换为PPT演示文稿。 功能特点 Markdown解析&#xff1a;自动解析Markdown文档结构PPT模板分析&#xff1a;分析PPT模板的布局和风格智能布局决策&#xff1a;匹配内容与合适的PPT布局自动…...

Qt Http Server模块功能及架构

Qt Http Server 是 Qt 6.0 中引入的一个新模块&#xff0c;它提供了一个轻量级的 HTTP 服务器实现&#xff0c;主要用于构建基于 HTTP 的应用程序和服务。 功能介绍&#xff1a; 主要功能 HTTP服务器功能&#xff1a; 支持 HTTP/1.1 协议 简单的请求/响应处理模型 支持 GET…...

第 86 场周赛:矩阵中的幻方、钥匙和房间、将数组拆分成斐波那契序列、猜猜这个单词

Q1、[中等] 矩阵中的幻方 1、题目描述 3 x 3 的幻方是一个填充有 从 1 到 9 的不同数字的 3 x 3 矩阵&#xff0c;其中每行&#xff0c;每列以及两条对角线上的各数之和都相等。 给定一个由整数组成的row x col 的 grid&#xff0c;其中有多少个 3 3 的 “幻方” 子矩阵&am…...

CVE-2020-17519源码分析与漏洞复现(Flink 任意文件读取)

漏洞概览 漏洞名称&#xff1a;Apache Flink REST API 任意文件读取漏洞CVE编号&#xff1a;CVE-2020-17519CVSS评分&#xff1a;7.5影响版本&#xff1a;Apache Flink 1.11.0、1.11.1、1.11.2修复版本&#xff1a;≥ 1.11.3 或 ≥ 1.12.0漏洞类型&#xff1a;路径遍历&#x…...

【JVM】Java虚拟机(二)——垃圾回收

目录 一、如何判断对象可以回收 &#xff08;一&#xff09;引用计数法 &#xff08;二&#xff09;可达性分析算法 二、垃圾回收算法 &#xff08;一&#xff09;标记清除 &#xff08;二&#xff09;标记整理 &#xff08;三&#xff09;复制 &#xff08;四&#xff…...

Golang——7、包与接口详解

包与接口详解 1、Golang包详解1.1、Golang中包的定义和介绍1.2、Golang包管理工具go mod1.3、Golang中自定义包1.4、Golang中使用第三包1.5、init函数 2、接口详解2.1、接口的定义2.2、空接口2.3、类型断言2.4、结构体值接收者和指针接收者实现接口的区别2.5、一个结构体实现多…...