Procházet zdrojové kódy

fix(aidop): 对齐 ProdLineDetail 与 crm_seorderentry 实体字段到 aidopdev 表结构。

补齐缺失列并修正字段类型差异,联动调整相关 DTO/服务映射逻辑,并同步版本到 Web 2.4.91 / API 1.0.58。

Made-with: Cursor
Pengxy před 1 měsícem
rodič
revize
518a7a301b

+ 1 - 1
Web/package.json

@@ -1,7 +1,7 @@
 {
 	"name": "admin.net",
 	"type": "module",
-	"version": "2.4.104",
+	"version": "2.4.105",
 	"packageManager": "pnpm@10.32.1",
 	"lastBuildTime": "2026.03.15",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",

+ 3 - 3
server/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj

@@ -11,9 +11,9 @@
     <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
     <Copyright>Admin.NET</Copyright>
     <Description>Admin.NET 通用权限开发平台</Description>
-    <AssemblyVersion>1.0.71</AssemblyVersion>
-    <FileVersion>1.0.71</FileVersion>
-    <Version>1.0.71</Version>
+    <AssemblyVersion>1.0.72</AssemblyVersion>
+    <FileVersion>1.0.72</FileVersion>
+    <Version>1.0.72</Version>
   </PropertyGroup>
 
   <ItemGroup>

+ 10 - 9
server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgLineMaterialsController.cs

@@ -31,19 +31,20 @@ public class AdoS0MfgLineMaterialsController : ControllerBase
         var page = q.EffectivePage;
         var pageSize = q.PageSize;
         (page, pageSize) = PagingGuard.Normalize(page, pageSize);
+        var hasKeywordOp = int.TryParse(q.Keyword, out var keywordOp);
 
         // 源平台 where IsActive=1;这里默认仅返回启用记录
         var query = _rep.AsQueryable()
             .Where(x => x.IsActive)
             .WhereIF(!string.IsNullOrWhiteSpace(q.Domain), x => x.Domain == q.Domain)
             .WhereIF(!string.IsNullOrWhiteSpace(q.Part), x => x.Part.Contains(q.Part!))
-            .WhereIF(!string.IsNullOrWhiteSpace(q.Op), x => x.Op != null && x.Op.Contains(q.Op!))
+            .WhereIF(q.Op.HasValue, x => x.Op == q.Op.Value)
             .WhereIF(!string.IsNullOrWhiteSpace(q.Site), x => x.Site != null && x.Site.Contains(q.Site!))
             .WhereIF(!string.IsNullOrWhiteSpace(q.Line), x => x.Line != null && x.Line.Contains(q.Line!))
             .WhereIF(!string.IsNullOrWhiteSpace(q.Keyword),
                 x =>
                     x.Part.Contains(q.Keyword!)
-                    || (x.Op != null && x.Op.Contains(q.Keyword!))
+                    || (hasKeywordOp && x.Op == keywordOp)
                     || (x.Site != null && x.Site.Contains(q.Keyword!))
                     || (x.Line != null && x.Line.Contains(q.Keyword!))
                     || (x.SkillNo != null && x.SkillNo.Contains(q.Keyword!)));
@@ -105,15 +106,15 @@ public class AdoS0MfgLineMaterialsController : ControllerBase
                 updateUser = x.UpdateUser,
                 updateTime = x.UpdateTime,
                 timeInMinutes,
-                opStdOp = x.Op == null ? "" : x.Op
+                opStdOp = x.Op.ToString()
             };
         }).ToList();
 
         return Ok(new { total, page, pageSize, list = shaped });
     }
 
-    [HttpGet("{id:long}")]
-    public async Task<IActionResult> GetAsync(long id)
+    [HttpGet("{id:int}")]
+    public async Task<IActionResult> GetAsync(int id)
     {
         var item = await _rep.GetByIdAsync(id);
         return item == null ? NotFound() : Ok(item);
@@ -148,8 +149,8 @@ public class AdoS0MfgLineMaterialsController : ControllerBase
         return Ok(entity);
     }
 
-    [HttpPut("{id:long}")]
-    public async Task<IActionResult> UpdateAsync(long id, [FromBody] AdoS0ProdLineDetailUpsertDto dto)
+    [HttpPut("{id:int}")]
+    public async Task<IActionResult> UpdateAsync(int id, [FromBody] AdoS0ProdLineDetailUpsertDto dto)
     {
         var entity = await _rep.GetByIdAsync(id);
         if (entity == null) return NotFound();
@@ -173,8 +174,8 @@ public class AdoS0MfgLineMaterialsController : ControllerBase
         return Ok(entity);
     }
 
-    [HttpDelete("{id:long}")]
-    public async Task<IActionResult> DeleteAsync(long id)
+    [HttpDelete("{id:int}")]
+    public async Task<IActionResult> DeleteAsync(int id)
     {
         var item = await _rep.GetByIdAsync(id);
         if (item == null) return NotFound();

+ 3 - 4
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Manufacturing/AdoS0ManufacturingDtos.cs

@@ -589,7 +589,7 @@ public class AdoS0ProdLineDetailQueryDto : AdoS0MfgPagedQueryBase
 {
     public string? Domain { get; set; }
     public string? Part { get; set; }
-    public string? Op { get; set; }
+    public int? Op { get; set; }
     public string? Site { get; set; }
     public string? Line { get; set; }
 }
@@ -600,8 +600,7 @@ public class AdoS0ProdLineDetailUpsertDto
     [MaxLength(100)]
     public string Part { get; set; } = string.Empty;
 
-    [MaxLength(100)]
-    public string? Op { get; set; }
+    public int Op { get; set; }
 
     [MaxLength(100)]
     public string? Site { get; set; }
@@ -614,7 +613,7 @@ public class AdoS0ProdLineDetailUpsertDto
     public string? SkillNo { get; set; }
     public string? InternalEquipmentTypeCode { get; set; }
     public string? MoldTypeCode { get; set; }
-    public int? StandardStaffCount { get; set; }
+    public decimal StandardStaffCount { get; set; }
     public int? Start { get; set; }
     public bool IsActive { get; set; } = true;
     public bool IsConfirm { get; set; }

+ 27 - 6
server/Plugins/Admin.NET.Plugin.AiDOP/Entity/S0/Manufacturing/AdoS0ProdLineDetail.cs

@@ -6,14 +6,14 @@ namespace Admin.NET.Plugin.AiDOP.Entity.S0.Manufacturing;
 [SugarTable("ProdLineDetail", "生产线物料维护表")]
 public class AdoS0ProdLineDetail
 {
-    [SugarColumn(ColumnName = "RecID", ColumnDescription = "生产线物料主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
-    public long Id { get; set; }
+    [SugarColumn(ColumnName = "RecID", ColumnDescription = "生产线物料主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "int")]
+    public int Id { get; set; }
 
     [SugarColumn(ColumnName = "Part", ColumnDescription = "物料编码", Length = 100)]
     public string Part { get; set; } = string.Empty;
 
-    [SugarColumn(ColumnName = "Op", ColumnDescription = "工序编码", Length = 100, IsNullable = true)]
-    public string? Op { get; set; }
+    [SugarColumn(ColumnName = "Op", ColumnDescription = "工序编码", ColumnDataType = "int")]
+    public int Op { get; set; }
 
     [SugarColumn(ColumnName = "Site", ColumnDescription = "工作中心编码", Length = 100, IsNullable = true)]
     public string? Site { get; set; }
@@ -27,17 +27,26 @@ public class AdoS0ProdLineDetail
     [SugarColumn(ColumnName = "SetupTime", ColumnDescription = "换模时间(小时)", DecimalDigits = 6, Length = 18, IsNullable = true)]
     public decimal? SetupTime { get; set; }
 
+    [SugarColumn(ColumnName = "OverlapTime", ColumnDescription = "重叠时间(小时)", DecimalDigits = 6, Length = 18, ColumnDataType = "decimal(18,6)")]
+    public decimal OverlapTime { get; set; }
+
+    [SugarColumn(ColumnName = "Sequence", ColumnDescription = "顺序值", DecimalDigits = 6, Length = 18, ColumnDataType = "decimal(18,6)")]
+    public decimal Sequence { get; set; }
+
     [SugarColumn(ColumnName = "SkillNo", ColumnDescription = "员工技能编码", Length = 100, IsNullable = true)]
     public string? SkillNo { get; set; }
 
+    [SugarColumn(ColumnName = "InternalEquipmentCode", ColumnDescription = "厂内设备编码", Length = 100, IsNullable = true)]
+    public string? InternalEquipmentCode { get; set; }
+
     [SugarColumn(ColumnName = "internal_equipment_type_code", ColumnDescription = "厂内设备类型编码", Length = 100, IsNullable = true)]
     public string? InternalEquipmentTypeCode { get; set; }
 
     [SugarColumn(ColumnName = "MoldTypeCode", ColumnDescription = "模具类型编码", Length = 100, IsNullable = true)]
     public string? MoldTypeCode { get; set; }
 
-    [SugarColumn(ColumnName = "StandardStaffCount", ColumnDescription = "标准人数", IsNullable = true)]
-    public int? StandardStaffCount { get; set; }
+    [SugarColumn(ColumnName = "StandardStaffCount", ColumnDescription = "标准人数", DecimalDigits = 6, Length = 18, ColumnDataType = "decimal(18,6)")]
+    public decimal StandardStaffCount { get; set; }
 
     [SugarColumn(ColumnName = "Start", ColumnDescription = "起始标记/顺序", IsNullable = true)]
     public int? Start { get; set; }
@@ -62,5 +71,17 @@ public class AdoS0ProdLineDetail
 
     [SugarColumn(ColumnName = "UpdateTime", ColumnDescription = "更新时间", IsNullable = true)]
     public DateTime? UpdateTime { get; set; }
+
+    [SugarColumn(ColumnName = "RunCrew", ColumnDescription = "运行班组", Length = 8, IsNullable = true)]
+    public string? RunCrew { get; set; }
+
+    [SugarColumn(ColumnName = "OpType", ColumnDescription = "工序类型", Length = 50, IsNullable = true)]
+    public string? OpType { get; set; }
+
+    [SugarColumn(ColumnName = "tenant_id", ColumnDescription = "租户ID", IsNullable = true, ColumnDataType = "bigint")]
+    public long? TenantId { get; set; }
+
+    [SugarColumn(ColumnName = "Bom", ColumnDescription = "BOM编码", Length = 24, IsNullable = true)]
+    public string? Bom { get; set; }
 }
 

+ 122 - 2
server/Plugins/Admin.NET.Plugin.AiDOP/Order/Entity/SeOrderEntry.cs

@@ -17,21 +17,63 @@ public class SeOrderEntry
     [SugarColumn(ColumnName = "entry_seq")]
     public int? EntrySeq { get; set; }
 
+    [SugarColumn(ColumnName = "map_number", Length = 255)]
+    public string? MapNumber { get; set; }
+
+    [SugarColumn(ColumnName = "map_name", Length = 255)]
+    public string? MapName { get; set; }
+
     [SugarColumn(ColumnName = "item_number", Length = 64)]
     public string? ItemNumber { get; set; }
 
+    [SugarColumn(ColumnName = "fms_number", Length = 255)]
+    public string? FmsNumber { get; set; }
+
     [SugarColumn(ColumnName = "item_name", Length = 128)]
     public string? ItemName { get; set; }
 
     [SugarColumn(ColumnName = "specification", Length = 256)]
     public string? Specification { get; set; }
 
+    [SugarColumn(ColumnName = "urgent")]
+    public int? Urgent { get; set; }
+
+    [SugarColumn(ColumnName = "bom_number", Length = 255)]
+    public string? BomNumber { get; set; }
+
     [SugarColumn(ColumnName = "unit", Length = 32)]
     public string? Unit { get; set; }
 
     [SugarColumn(ColumnName = "qty")]
     public decimal? Qty { get; set; }
 
+    [SugarColumn(ColumnName = "price")]
+    public decimal? Price { get; set; }
+
+    [SugarColumn(ColumnName = "tax_price")]
+    public decimal? TaxPrice { get; set; }
+
+    [SugarColumn(ColumnName = "amount")]
+    public decimal? Amount { get; set; }
+
+    [SugarColumn(ColumnName = "tax_rate")]
+    public decimal? TaxRate { get; set; }
+
+    [SugarColumn(ColumnName = "discount_rate")]
+    public decimal? DiscountRate { get; set; }
+
+    [SugarColumn(ColumnName = "discount_amount")]
+    public decimal? DiscountAmount { get; set; }
+
+    [SugarColumn(ColumnName = "aux_price_discount")]
+    public decimal? AuxPriceDiscount { get; set; }
+
+    [SugarColumn(ColumnName = "tax_amtount")]
+    public decimal? TaxAmtount { get; set; }
+
+    [SugarColumn(ColumnName = "total_amount")]
+    public decimal? TotalAmount { get; set; }
+
     /// <summary>瀹㈡埛瑕佹眰浜ゆ湡</summary>
     [SugarColumn(ColumnName = "plan_date")]
     public DateTime? PlanDate { get; set; }
@@ -44,28 +86,106 @@ public class SeOrderEntry
     [SugarColumn(ColumnName = "sys_capacity_date")]
     public DateTime? SysCapacityDate { get; set; }
 
+    [SugarColumn(ColumnName = "planner_name", Length = 50)]
+    public string? PlannerName { get; set; }
+
+    [SugarColumn(ColumnName = "planner_no", Length = 50)]
+    public string? PlannerNo { get; set; }
+
     [SugarColumn(ColumnName = "remark", Length = 512)]
     public string? Remark { get; set; }
 
-    /// <summary>0=鍐嶈瘎瀹?1=鏂板缓 2=璇勫 3=纭</summary>
+    [SugarColumn(ColumnName = "adjust_date")]
+    public DateTime? AdjustDate { get; set; }
+
+    [SugarColumn(ColumnName = "mrp_closed")]
+    public bool? MrpClosed { get; set; }
+
+    [SugarColumn(ColumnName = "op_time")]
+    public DateTime? OpTime { get; set; }
+
+    [SugarColumn(ColumnName = "custom_order_itemno", Length = 80)]
+    public string? CustomOrderItemno { get; set; }
+
+    [SugarColumn(ColumnName = "state")]
+    public bool? State { get; set; }
+
+    [SugarColumn(ColumnName = "rstate")]
+    public int? RState { get; set; }
+
+    [SugarColumn(ColumnName = "soure_bill_no", Length = 50)]
+    public string? SoureBillNo { get; set; }
+
+    [SugarColumn(ColumnName = "custom_order_bill_no", Length = 50)]
+    public string? CustomOrderBillNo { get; set; }
+
+    [SugarColumn(ColumnName = "custom_order_entryid")]
+    public int? CustomOrderEntryId { get; set; }
+
+    /// <summary>0=再评审 1=新建 2=评审 3=确认</summary>
     [SugarColumn(ColumnName = "progress")]
-    public int? Progress { get; set; } = 1;
+    public string? Progress { get; set; } = "1";
+
+    [SugarColumn(ColumnName = "deliver_notice_count")]
+    public decimal? DeliverNoticeCount { get; set; }
 
     [SugarColumn(ColumnName = "deliver_count")]
     public decimal? DeliverCount { get; set; }
 
+    [SugarColumn(ColumnName = "se_reject_reason", Length = 80)]
+    public string? SeRejectReason { get; set; }
+
+    [SugarColumn(ColumnName = "out_stock_type", Length = 50)]
+    public string? OutStockType { get; set; }
+
+    [SugarColumn(ColumnName = "is_checked")]
+    public bool? IsChecked { get; set; }
+
+    [SugarColumn(ColumnName = "sys_material_date")]
+    public DateTime? SysMaterialDate { get; set; }
+
+    [SugarColumn(ColumnName = "contract_no", Length = 50)]
+    public string? ContractNo { get; set; }
+
+    [SugarColumn(ColumnName = "create_dept")]
+    public long? CreateDept { get; set; }
+
     [SugarColumn(ColumnName = "create_by")]
     public long? CreateBy { get; set; }
 
+    [SugarColumn(ColumnName = "create_by_name", Length = 50)]
+    public string? CreateByName { get; set; }
+
+    [SugarColumn(ColumnName = "company_id")]
+    public long? CompanyId { get; set; }
+
     [SugarColumn(ColumnName = "IsDeleted")]
     public int IsDeleted { get; set; } = 0;
 
     [SugarColumn(ColumnName = "create_time")]
     public DateTime? CreateTime { get; set; }
 
+    [SugarColumn(ColumnName = "update_by")]
+    public long? UpdateBy { get; set; }
+
+    [SugarColumn(ColumnName = "update_by_name", Length = 50)]
+    public string? UpdateByName { get; set; }
+
     [SugarColumn(ColumnName = "update_time")]
     public DateTime? UpdateTime { get; set; }
 
+    [SugarColumn(ColumnName = "factory_id")]
+    public long? FactoryId { get; set; }
+
+    [SugarColumn(ColumnName = "org_id")]
+    public long? OrgId { get; set; }
+
+    [SugarColumn(ColumnName = "rnumber")]
+    public int? RNumber { get; set; }
+
+    [SugarColumn(ColumnName = "seorderentry_id")]
+    public long? SeOrderEntryId { get; set; }
+
     /// <summary>绉熸埛ID锛堝绉熸埛闅旂锛?/summary>
     [SugarColumn(ColumnName = "tenant_id", IsNullable = true)]
     public long? TenantId { get; set; }

+ 10 - 1
server/Plugins/Admin.NET.Plugin.AiDOP/Order/SeOrderAuditHelper.cs

@@ -133,7 +133,16 @@ internal static class SeOrderAuditHelper
         ["最终交货日期"] = e.Date?.ToString("yyyy-MM-dd"),
         ["系统建议交期"] = e.SysCapacityDate?.ToString("yyyy-MM-dd"),
         ["备注"] = e.Remark,
-        ["进度"] = e.Progress switch { 0 => "再评审", 1 => "新建", 2 => "评审", 3 => "确认", _ => e.Progress?.ToString() },
+        ["进度"] = ToProgressText(e.Progress),
         ["交付数量"] = e.DeliverCount?.ToString("0.######"),
     };
+
+    private static string? ToProgressText(string? progress) => progress switch
+    {
+        "0" => "再评审",
+        "1" => "新建",
+        "2" => "评审",
+        "3" => "确认",
+        _ => progress
+    };
 }

+ 7 - 7
server/Plugins/Admin.NET.Plugin.AiDOP/Order/SeOrderService.cs

@@ -93,10 +93,10 @@ public class SeOrderService : IDynamicApiController, ITransient
             a.flowstate        AS FlowState,
             entry.progress     AS Progress,
             CASE
-                WHEN entry.progress = 1 THEN '新建'
-                WHEN entry.progress = 2 THEN '评审'
-                WHEN entry.progress = 0 THEN '再评审'
-                WHEN entry.progress = 3 THEN '确认'
+                WHEN entry.progress = '1' THEN '新建'
+                WHEN entry.progress = '2' THEN '评审'
+                WHEN entry.progress = '0' THEN '再评审'
+                WHEN entry.progress = '3' THEN '确认'
                 ELSE '确认'
             END                AS State,
             chg.change_content AS ChangeContent,
@@ -342,7 +342,7 @@ public class SeOrderService : IDynamicApiController, ITransient
                 entry.SeOrderId = orderId;
                 entry.BillNo = billNo;
                 entry.EntrySeq = seq;
-                entry.Progress ??= 0;
+                entry.Progress ??= "0";
                 entry.CreateBy = _userManager.UserId;
                 entry.IsDeleted = 0;
                 entry.CreateTime = DateTime.Now;
@@ -403,7 +403,7 @@ public class SeOrderService : IDynamicApiController, ITransient
         public string? CustomNo { get; set; }
         public string? SortName { get; set; }
         public DateTime? RDate { get; set; }
-        public int? Progress { get; set; }
+        public string? Progress { get; set; }
         public string? State { get; set; }
         public string? ChangeContent { get; set; }
         public int? ChangeNum { get; set; }
@@ -441,7 +441,7 @@ public class SeOrderService : IDynamicApiController, ITransient
         public string? Remark { get; set; }
         public string? Unit { get; set; }
         public decimal? DeliverCount { get; set; }
-        public int? Progress { get; set; }
+        public string? Progress { get; set; }
     }
 
     private sealed class SimpleKvRow