添加项目文件。

This commit is contained in:
2026-04-30 11:34:41 +08:00
parent a8539ccaac
commit 80635aa46e
181 changed files with 16378 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
using Models.Models;
using SamplePre.Common;
using SamplePre.Communication;
using SamplePre.Models.Ext;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Const
{
public class SystemConst
{
/// <summary>
/// 运行、成功色-绿色
/// </summary>
public static Color SuccessColor = Color.FromArgb(40, 167, 69); // 运行、成功色-绿色
/// <summary>
/// 待机-浅绿色
/// </summary>
public static Color AwaitColor = Color.FromArgb(66, 202, 171); // 待机-浅绿色
/// <summary>
/// 结束
/// </summary>
public static Color FinishColor = Color.FromArgb(22, 167, 169); // 运行、成功色-绿色
/// <summary>
/// 警告色-黄色
/// </summary>
public static Color WarningColor = Color.FromArgb(255, 193, 7); // 停止、警告色-黄色
/// <summary>
/// 危险色-红色
/// </summary>
public static Color DangerColor = Color.FromArgb(220, 53, 69); // 危险色-红色
/// <summary>
/// 主PLC对象
/// </summary>
public static ICommunication MasterPLC;
/// <summary>
/// 字典数据
/// </summary>
public static List<sys_dict> dictDatas = new List<sys_dict>();
public static SysConfigData SysConfigInfo = new SysConfigData();
/// <summary>
/// 当前通信协议类型
/// </summary>
public static CommProtocolType ProtocolType = CommProtocolType.ModbusTcp;
/// <summary>
/// 当前登录用户信息
/// </summary>
public static LoginUserInfo loginUserInfo = new LoginUserInfo();
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
{
public enum LiXinJiEnum
{
//待机
Wait = 0,
//运行
Run = 1,
//故障
Err = 2
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Ext
{
public class LogQuery
{
public string runDate { get; set; }
public string errType { get; set; }
public string errlevel { get; set; }
public string content { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using SamplePre.Models.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class LoginUserInfo
{
/// <summary>
/// 用户信息
/// </summary>
public config_user user { get; set; }
/// <summary>
/// 功能权限
/// </summary>
public List<config_function> functions { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Ext
{
public class MenuNode
{
public string Id { get; set; }
public string Name { get; set; }
public string Icon { get; set; }
public List<MenuNode> Children { get; set; }
//public MenuNode(string id, string name, List<MenuNode> children = null)
//{
// Id = id;
// Name = name;
// Children = children ?? new List<MenuNode>();
//}
}
}

View File

@@ -0,0 +1,17 @@
using SamplePre.Models.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class config_function_ext : config_function
{
public bool IsChecked { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using SamplePre.Models.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class config_role_ext : config_role
{
public bool IsSelected { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using SamplePre.Models.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class config_user_ext : config_user
{
public string all_role_names { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using SamplePre.Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class sample_exec_detail_ext : sample_exec_detail
{
public string exec_state { get; set; }
public string item_name { get; set; }
public string standrad_id { get; set; }
public string standrad { get; set; }
public DateTime input_date { get; set; }
public string input_user { get; set; }
public string tube_type_name { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using SamplePre.Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class sample_exec_ext : sample_exec
{
public string standradName { get; set; }
public List<sample_exec_detail> sampleExecDetails { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class sys_action_ext : sys_action
{
public string action_unitname { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Ext
{
public class sys_action_parm_map_ext
{
public int id { get; set; }
public string process_id { get; set; }
public string parm_id { get; set; }
public string process_name { get; set; }
public string title { get; set; }
public string unit { get; set; }
public string data_type { get; set; }
public string data_value { get; set; }
public string plc_type { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
using Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class sys_standard_action_ext : sys_standard_action
{
public string action_name { get; set; }
public string remark { get; set; }
public string all_param { get; set; }
public string action_unit { get; set; }
public string action_unit_name { set; get; }
public int new_action_seqno { set; get; }
/// <summary>
/// 执行完成标识
/// </summary>
public bool ExecFinishFlag { set; get; } = false;
}
}

View File

@@ -0,0 +1,21 @@
using Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class sys_standard_action_parm_ext : sys_standard_action_parm
{
public string action_name { get; set; }
public string title { get; set; }
public string unit { get; set; }
public string data_type { get; set; }
public string plc_type { get; set; }
public string actionAndseqno { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
using Models.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class sys_standard_ext : sys_standard ,INotifyPropertyChanged
{
//public bool IsSelected { get; set; }
private bool _isSelected;
public bool IsSelected
{
get { return _isSelected; }
set { _isSelected = value;
OnPropertyChanged();
}
}
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public event PropertyChangedEventHandler? PropertyChanged;
}
}

View File

@@ -0,0 +1,40 @@
using Models.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Ext
{
public class tube_input_ext : tube_input,INotifyPropertyChanged
{
//public bool isChecked { get; set; } = false;
public string tube_type_name { get; set; }
private bool isSelected = false;
public event PropertyChangedEventHandler? PropertyChanged;
public bool IsSelected
{
get { return isSelected; }
set
{
isSelected = value;
OnPropertyChanged();
}
}
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models
{
public class ComboBoxListItem : Object
{
public string Text { get; set; }
public object Value { get; set; }
public ComboBoxListItem(string text, object value)
{
this.Text = text;
this.Value = value;
}
public override string ToString()
{
return this.Text;
}
}
}

View File

@@ -0,0 +1,18 @@
using Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models
{
public class SopDataInfo
{
public sys_standard sysStandard { get; set; } = new sys_standard();
public List<sys_standard_action> sysStandActions { get; set; } = new List<sys_standard_action>();
public List<sys_standard_action_parm> sysStandardActionParms { get; set; } = new List<sys_standard_action_parm>();
}
}

View File

@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
{
using System.Xml.Serialization;
/// <summary>
/// 系统配置根实体类对应XML根节点SystemConfig
/// </summary>
[XmlRoot("SystemConfig")]
public class SysConfigData
{
/// <summary>
/// 数据库配置对应DbConfig节点
/// </summary>
[XmlElement("DbConfig")]
public DbConfigModel DbConfig { get; set; }
/// <summary>
/// 应用配置对应AppConfig节点
/// </summary>
[XmlElement("AppConfig")]
public AppConfigModel AppConfig { get; set; }
}
/// <summary>
/// 数据库配置实体对应DbConfig节点
/// </summary>
public class DbConfigModel
{
/// <summary>
/// SQL Server配置对应SqlServer节点含属性
/// </summary>
[XmlElement("SqlServer")]
public DbItemModel SqlServer { get; set; }
/// <summary>
/// MySQL配置对应MySql节点含属性
/// </summary>
[XmlElement("MySql")]
public DbItemModel MySql { get; set; }
}
/// <summary>
/// 数据库子项配置对应SqlServer/MySql节点含属性
/// </summary>
public class DbItemModel
{
/// <summary>
/// 连接串对应ConnStr属性
/// </summary>
[XmlAttribute("ConnStr")]
public string ConnStr { get; set; }
/// <summary>
/// 超时时间对应TimeOut属性
/// </summary>
[XmlAttribute("TimeOut")]
public int TimeOut { get; set; }
}
/// <summary>
/// 应用配置实体对应AppConfig节点
/// </summary>
public class AppConfigModel
{
[XmlElement("AppName")]
public string AppName { get; set; }
[XmlElement("Version")]
public string Version { get; set; }
[XmlElement("MaxLoginCount")]
public int MaxLoginCount { get; set; }
[XmlElement("IsDebug")]
public bool IsDebug { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models
{
// 定义树节点数据模型
public class TreeListItem
{
// 节点唯一ID主键
public string ID { get; set; }
// 父节点ID根节点的ParentID为0子节点对应父节点的ID
public string ParentID { get; set; }
// 节点显示的文本
public string DisplayText { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SqlSugar" Version="5.1.4.207" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SamplePre.Common\SamplePre.Common.csproj" />
<ProjectReference Include="..\SamplePre.Communication\SamplePre.Communication.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class QRcode
{
public string code { get; set; }
public string checkItem { get; set; } //检测项目
public string jizhi { get; set; } // 基质
public string sqno { get; set; } // 序号
public string position { get; set; } // 试管位置
public string stand { get; set; } // 标准
public string user { get; set; } //录入人员
public string inputDate { get; set; } //录入日期
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Tables
{
public class config_function
{
public int id { get; set; } // 功能ID
public string name { get; set; } // 功能名称(如:用户管理、角色新增)
public string code { get; set; } // 功能编码唯一标识User_Manage
public int parent_id { get; set; } // 父功能编码(用于构建菜单层级)
public string description { get; set; } // 功能描述
}
}

View File

@@ -0,0 +1,21 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Tables
{
public class config_role
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
public string id { get; set; } // 角色ID
public string name { get; set; } // 角色名称(如:管理员、普通用户)
public string description { get; set; } // 角色描述
}
}

View File

@@ -0,0 +1,20 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Tables
{
public class config_role_permisson
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
public int id { get; set; }
public string role_id { get; set; }
public int function_id { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Tables
{
public class config_user
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
public string id { get; set; } // 用户ID
public string username { get; set; } // 用户名
public string password { get; set; } // 密码(实际项目需加密存储)
public bool is_enabled { get; set; } // 是否启用
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Tables
{
public class config_user_role
{
public int id { get; set; }
public string user_id { get; set; }
public string role_id { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class run_log_info
{
public string id { get; set; }
public DateTime run_date { get; set; }
/// <summary>
/// 信息,警告,故障
/// </summary>
public string log_level { get; set; }
public string log_content { get; set; }
public string log_type { get; set; }
/// <summary>
/// 运行时间
/// </summary>
public string run_time { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Models
{
public class sample_exec
{
public string id { get; set; }
public string standrad_id { get; set; }
public string cmd_content { get; set; }
public string cmd_content2 { get; set; }
public string qrcodes { get; set; }
public int sample_count { get; set; }
public string exec_state { get; set; }
public DateTime exec_date { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Models
{
public class sample_exec_detail
{
public int id { get; set; }
public string master_id { get; set; }
public string qrcode { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
/// <summary>
/// 样本记录
/// </summary>
public class sample_record
{
public int id { get; set; }
public string qrcode { get; set; }
public string check_item { get; set; }
public string jizhi { get; set; }
public string xuhao { get; set; }
public string standard_id { get; set; }
public string input_user { get; set; }
public DateTime inpu_date { get; set; }
public string weight { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class sys_action
{
public string id { get; set; }
public string action_name { get; set; }
public string action_unit { get; set; }
public string action_adress { get; set; }
public string plc_type { get; set; }
public string remark { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class sys_action_parm_map
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int id { get; set; }
public string process_id { get; set; }
public string parm_id { get; set; }
//public string parm_name { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class sys_dict
{
public string id { get; set; }
public string data_type { get; set; }
public string data_value { get; set; }
public int class_id { get;set; }
public string remark { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePre.Models.Models
{
public class sys_dict_class
{
public int id { get; set; }
public string dict_type { get; set; }
public string remark { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class sys_parm
{
[SugarColumn(IsPrimaryKey = true)]
//[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public string id { get; set; }
public string title { get; set; }
public string unit { get; set; }
public string data_type { get; set; }
public string data_value { get; set; }
public string plc_type { get; set; }
public string param_type { get;set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class sys_standard
{
public string id { get; set; }
public string sample_id { get; set; }
//public string sample_name { get; set; }
public string standard_name { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class sys_standard_action
{
public string id { get; set; }
public string standard_id { get; set; }
public string process_id { get; set; }
//public string process_name { get; set; }
public int process_no { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class sys_standard_action_parm
{
//[SugarColum(IsPrimaryKey = true)]
public string id { get; set; }
public string standard_id { get; set; }
public string action_id { get; set; }
public int action_seqno { get; set; }
public string parm_id { get; set; }
public int parm_seqno { get; set; }
public int standard_process_id { get; set; }
public string data_value { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Models
{
public class tube_input
{
public string qrcode { get; set; }
public string item_name { get; set; }
public string tube_type { get; set; }
public string standrad_id { get; set; }
public string standrad { get; set; }
public string input_user { get; set; }
public DateTime input_date { get; set; }
public string weight { get; set; }
public int tube_count { get; set; }
public string bach_no { get; set; }
}
}