20260831功能同步:
1. 不同车间区分料框查询、料框解绑接口 2. 注释电池型号逻辑 3. 打开电池状况界面
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.DAL.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 料框码规则表
|
||||
/// </summary>
|
||||
[SugarTable("material_frame_rule")]
|
||||
public class MaterialFrameRule
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 料框码规则起始匹配编码(第4-7位)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "start_code", Length = 20, IsNullable = false)]
|
||||
public string Start_Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车间编码 (如 601)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "workshop_code", Length = 10, IsNullable = false)]
|
||||
public string Workshop_Code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 逻辑删除标识 (0:正常, 1:已删除)
|
||||
/// 注意:建议在Service层统一过滤此字段,不直接参与常规业务查询映射
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "is_deleted")]
|
||||
public bool Is_Deleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "update_time", IsOnlyIgnoreUpdate = true)] // 插入时由数据库默认值处理,更新时自动更新
|
||||
public DateTime Update_Time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.DAL.Models
|
||||
{
|
||||
public static class ModelExtension
|
||||
{
|
||||
public static T ToModel<T>(this System.Data.DataRow row) where T : class, new()
|
||||
{
|
||||
if (row == null) return null;
|
||||
T model = new T();
|
||||
var type = typeof(T);
|
||||
var properties = type.GetProperties();
|
||||
foreach (var prop in properties)
|
||||
{
|
||||
if (row.Table.Columns.Contains(prop.Name))
|
||||
{
|
||||
var value = row[prop.Name];
|
||||
if (value != DBNull.Value)
|
||||
{
|
||||
prop.SetValue(model, Convert.ChangeType(value, prop.PropertyType));
|
||||
}
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.DAL.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 车间接口配置表
|
||||
/// </summary>
|
||||
[SugarTable("workshop_interface_config")]
|
||||
public class WorkshopInterfaceConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车间编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "workshop_code", Length = 10, IsNullable = false)]
|
||||
public string Workshop_Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 接口标识 (如 QueryTrayUrl)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "interface_flag", Length = 50, IsNullable = false)]
|
||||
public string Interface_Flag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 接口名称 (如 料框查询)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "interface_name", Length = 100, IsNullable = true)]
|
||||
public string Interface_Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 接口URL地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "interface_url", Length = 500, IsNullable = true)]
|
||||
public string Interface_Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 逻辑删除标识 (0:正常, 1:已删除)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "is_deleted", IsIgnore = true)]
|
||||
public bool Is_Deleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "update_time", IsOnlyIgnoreUpdate = true)]
|
||||
public DateTime Update_Time { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user