From 362fb69c690a2b36e251996f8b22d87e97d385ba Mon Sep 17 00:00:00 2001
From: cnf <3200815559@qq.com>
Date: 星期三, 12 二月 2025 16:06:33 +0800
Subject: [PATCH] 新增销售订单保存接口,销售退货通知单保存接口,销售发货通知单保存接口

---
 MES.Service/Modes/SalesReturnNoticeDetail.cs                                |  144 +-
 MESApplication/bin/Debug/net8.0/MES.Service.pdb                             |    0 
 MES.Service/Dto/webApi/SalesOrders.cs                                       |    9 
 MES.Service/Modes/SalesOrder.cs                                             |  189 ++
 MESApplication/bin/Debug/net8.0/MES.Service.dll                             |    0 
 MES.Service/Dto/webApi/SaleDeliveryNotice.cs                                |   14 
 MESApplication/bin/Debug/net8.0/MESApplication.pdb                          |    0 
 MES.Service/service/BasicData/SalesDeliveryNoticeDetailManager.cs           |   80 +
 MES.Service/Dto/webApi/ErpSalesOrder.cs                                     |   42 
 MES.Service/Dto/webApi/ErpSalesReturnNotice.cs                              |   41 
 MES.Service/Dto/webApi/ErpSalesReturnNoticeDetail.cs                        |   33 
 MES.Service/bin/Debug/net8.0/MES.Service.pdb                                |    0 
 MES.Service/Dto/webApi/ErpSalesOrderDetail.cs                               |   37 
 MES.Service/Modes/SalesOrderDetail.cs                                       |  273 +++-
 MES.Service/service/BasicData/SalesDeliveryNoticeManager.cs                 |  262 +++++
 MESApplication/bin/Debug/net8.0/MESApplication.dll                          |    0 
 MESApplication/Controllers/BasicData/SalesOrderController.cs                |  115 ++
 MES.Service/bin/Debug/net8.0/MES.Service.dll                                |    0 
 MESApplication/bin/Debug/net8.0/MESApplication.xml                          |  108 ++
 MES.Service/Dto/webApi/ErpSalesDeliveryNotice.cs                            |   44 
 MES.Service/Dto/webApi/ErpSalesDeliveryNoticeDetail.cs                      |   41 
 MES.Service/Dto/webApi/SaleReturnNotice.cs                                  |    9 
 MES.Service/Modes/SalesDeliveryNotice.cs                                    |  276 +++++
 MESApplication/bin/Debug/net8.0/MESApplication.exe                          |    0 
 MESApplication/Controllers/BasicData/SalesReturnNoticeController.cs         |  115 ++
 MES.Service/Modes/SalesDeliveryNoticeDetail.cs                              |  211 ++++
 MESApplication/Controllers/BasicData/SalesDeliveryNoticeController.cs       |  278 +++++
 MES.Service/service/BasicData/SalesReturnNoticeManager.cs                   |  179 +++
 MESApplication/Controllers/BasicData/SalesDeliveryNoticeDetailController.cs |  163 +++
 MES.Service/service/BasicData/SalesOrderManager.cs                          |  188 +++
 MES.Service/Modes/SalesReturnNotice.cs                                      |  241 ++++
 31 files changed, 2,855 insertions(+), 237 deletions(-)

diff --git a/MES.Service/Dto/webApi/ErpSalesDeliveryNotice.cs b/MES.Service/Dto/webApi/ErpSalesDeliveryNotice.cs
new file mode 100644
index 0000000..cefd4ee
--- /dev/null
+++ b/MES.Service/Dto/webApi/ErpSalesDeliveryNotice.cs
@@ -0,0 +1,44 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+    public class ErpSalesDeliveryNotice
+    {
+        public string? Id { get; set; }
+        public string? type { get; set; }
+        public string? erpID { get; set; }
+        public string? fBillTypeID { get; set; }
+        public string? fBillNo { get; set; }
+        public string? fDate { get; set; }
+        public string? fSettleCurrld { get; set; }
+        public string? fSaleDeptId { get; set; }
+        public string? fCustomerID { get; set; }
+        public string? fHeadDeliveryWay { get; set; }
+        public string? fHeadLocId { get; set; }
+        public string? fCarrierID { get; set; }
+        public string? fCarriageNO { get; set; }
+        public string? fDeliveryDeptID { get; set; }
+        public string? fStockerGroupId { get; set; }
+        public string? fStockerId { get; set; }
+        public string? fSaleGroupId { get; set; }
+        public string? fSalesManId { get; set; }
+        public string? fReceiveCusId { get; set; }
+        public string? fReceiveCusContact { get; set; }
+        public string? fReceiveAddress { get; set; }
+        public string? fLinkMan { get; set; }
+        public string? fLinkPhone { get; set; }
+        public string? fSettleID { get; set; }
+        public string? fPayerID { get; set; }
+        public string? fCreatorId { get; set; }
+        public string? fCreateDate { get; set; }
+        public string? fModifierId { get; set; }
+        public string? fModifyDate { get; set; }
+        public string? fApproverId { get; set; }
+        public string? fApproveDate { get; set; }
+        public string? fCloserId { get; set; }
+        public string? fCloseReason { get; set; }
+        public string? fBillCloseStatus { get; set; }
+        public string? fCancelStatus { get; set; }
+        public string? fCancellerId { get; set; }
+        public string? fCancelDate { get; set; }
+        public string? fDocumentStatus { get; set; }
+    }
+}
diff --git a/MES.Service/Dto/webApi/ErpSalesDeliveryNoticeDetail.cs b/MES.Service/Dto/webApi/ErpSalesDeliveryNoticeDetail.cs
new file mode 100644
index 0000000..724e76f
--- /dev/null
+++ b/MES.Service/Dto/webApi/ErpSalesDeliveryNoticeDetail.cs
@@ -0,0 +1,41 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+    public class ErpSalesDeliveryNoticeDetail
+    {
+        public string? Id { get; set; }
+        public string? type { get; set; }
+        public string? erpID { get; set; }
+        public string? ehid { get; set; }
+        public string? fMaterialId { get; set; }
+        public string? fUnitID { get; set; }
+        public string? fQty { get; set; }
+        public string? fIsFree { get; set; }
+        public string? fDeliverydate { get; set; }
+        public string? fStockId { get; set; }
+        public string? fMtoNo { get; set; }
+        public string? fLot { get; set; }
+        public string? fStockUnitID { get; set; }
+        public string? fStockQty { get; set; }
+        public string? fOwnerTypeID { get; set; }
+        public string? fOwnerId { get; set; }
+        public string? fSrcType { get; set; }
+        public string? fSrcBillNo { get; set; }
+        public string? fOrderNo { get; set; }
+        public string? fPriceUnitQty { get; set; }
+        public string? fOwnerIdHead { get; set; }
+        public string? fPlanDeliveryDate { get; set; }
+        public string? fOutLmtUnit { get; set; }
+        public string? fOutMaxQty { get; set; }
+        public string? fOutMinQty { get; set; }
+        public string? fDeliveryLoc { get; set; }
+        public string? fDeliveryLAddress { get; set; }
+        public string? fTerminationStatus { get; set; }
+        public string? fTerminateDate { get; set; }
+        public string? fSumOutQty { get; set; }
+        public string? fRemainOutQty { get; set; }
+        public string? FNoteEntry { get; set; }
+        
+
+
+    }
+}
diff --git a/MES.Service/Dto/webApi/ErpSalesOrder.cs b/MES.Service/Dto/webApi/ErpSalesOrder.cs
new file mode 100644
index 0000000..d35eb18
--- /dev/null
+++ b/MES.Service/Dto/webApi/ErpSalesOrder.cs
@@ -0,0 +1,42 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+    public class ErpSalesOrder
+    {
+        public string? Id { get; set; }
+        public string? Type { get; set; }
+        public string? ErpID { get; set; }
+        public string? FBillNo { get; set; }
+        public string? FBillTypeID { get; set; }
+        public string? FDocumentStatus { get; set; }
+        public string? FDate { get; set; }
+        public string? FBusinessType { get; set; }
+        public string? FHeadDeliveryWay { get; set; }
+        public string? FHEADLOCID { get; set; }
+        public string? FCustId { get; set; }
+        public string? FCloseStatus { get; set; }
+        public string? FSaleDeptId { get; set; }
+        public string? FSalerId { get; set; }
+        public string? FChangeReason { get; set; }
+        public string? FNote { get; set; }
+        public string? FSettleId { get; set; }
+        public string? FApproverId { get; set; }
+        public string? FLinkMan { get; set; }
+        public string? FChargeId { get; set; }
+        public string? FLinkPhone { get; set; }
+        public string? FCreatorId { get; set; }
+        public string? FCreateDate { get; set; }
+        public string? FModifierId { get; set; }
+        public string? FModifyDate { get; set; }
+        public string? FApproveDate { get; set; }
+        public string? FCloserId { get; set; }
+        public string? FCloseDate { get; set; }
+        public string? FChangeDate { get; set; }
+        public string? FCancelStatus { get; set; }
+        public string? FCancellerId { get; set; }
+        public string? FVersionNo { get; set; }
+        public string? FChangerId { get; set; }
+        public string? FEntryNote { get; set; }
+
+
+    }
+}
diff --git a/MES.Service/Dto/webApi/ErpSalesOrderDetail.cs b/MES.Service/Dto/webApi/ErpSalesOrderDetail.cs
new file mode 100644
index 0000000..89f584e
--- /dev/null
+++ b/MES.Service/Dto/webApi/ErpSalesOrderDetail.cs
@@ -0,0 +1,37 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+    public class ErpSalesOrderDetail
+    {
+        public string? Id { get; set; }
+        public string? Type { get; set; }
+        public string? FMaterialId { get; set; }
+        public string? FUnitID { get; set; }
+        public string? FQty { get; set; }
+        public string? FPriceUnitId { get; set; }
+        public string? FPriceUnitQty { get; set; }
+        public string? FDeliveryDate { get; set; }
+        public string? FIsFree { get; set; }
+        public string? FOwnerTypeId { get; set; }
+        public string? FOwnerId { get; set; }
+        public string? FEntryNote { get; set; }
+        public string? FMtoNo { get; set; }
+        public string? FLot { get; set; }
+        public string? FDeliveryMaxQty { get; set; }
+        public string? FDeliveryMinQty { get; set; }
+        public string? FOutLmtUnitID { get; set; }
+        public string? FMrpCloseStatus { get; set; }
+        public string? FMrpTerminateStatus { get; set; }
+        public string? FTerminateDate { get; set; }
+        public string? FTerminaterId { get; set; }
+        public string? FSrcType { get; set; }
+        public string? FSrcBillNo { get; set; }
+        public string? FDeliQty { get; set; }
+        public string? FStockOutQty { get; set; }
+        public string? FBaseRetNoticeQty { get; set; }
+        public string? FBaseReturnQty { get; set; }
+        public string? FBaseRemainOutQty { get; set; }
+        public string? FBASEARQTY { get; set; }
+        public string? ErpID { get; set; }
+        public string? EHID { get; set; }
+    }
+}
diff --git a/MES.Service/Dto/webApi/ErpSalesReturnNotice.cs b/MES.Service/Dto/webApi/ErpSalesReturnNotice.cs
new file mode 100644
index 0000000..404033f
--- /dev/null
+++ b/MES.Service/Dto/webApi/ErpSalesReturnNotice.cs
@@ -0,0 +1,41 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+    public class ErpSalesReturnNotice
+    {
+        public string? Id { get; set; }
+        public string? type { get; set; }
+        public string? erpID { get; set; }
+        public string? fBillTypeID { get; set; }
+        public string? fBillNo { get; set; }
+        public string? fDate { get; set; }
+        public string? fSettleCurrld { get; set; }
+        public string? fSaleDeptId { get; set; }
+        public string? fRetcustId { get; set; }
+        public string? fRetcustReason { get; set; }
+        public string? fHeadLocId { get; set; }
+        public string? fRetDeptId { get; set; }
+        public string? fStockerGroupId { get; set; }
+        public string? fStockerId { get; set; }
+        public string? fSaleGroupId { get; set; }
+        public string? fSalesManId { get; set; }
+        public string? fReceiveCusId { get; set; }
+        public string? fReceiveCusContact { get; set; }
+        public string? fReceiveAddress { get; set; }
+        public string? fLinkMan { get; set; }
+        public string? fSettleCusId { get; set; }
+        public string? fCreatorId { get; set; }
+        public string? fCreateDate { get; set; }
+        public string? fModifierId { get; set; }
+        public string? fModifyDate { get; set; }
+        public string? fCloserId { get; set; }
+        public string? fCloseReason { get; set; }
+        public string? fCloseDate { get; set; }
+        public string? fApproverId { get; set; }
+        public string? fApproveDate { get; set; }
+        public string? fCancelStatus { get; set; }
+        public string? fCancellerId { get; set; }
+        public string? fCancelDate { get; set; }
+        public string? fBillCloseStatus { get; set; }
+        public string? fDocumentStatus { get; set; }
+    }
+}
diff --git a/MES.Service/Dto/webApi/ErpSalesReturnNoticeDetail.cs b/MES.Service/Dto/webApi/ErpSalesReturnNoticeDetail.cs
new file mode 100644
index 0000000..092ffbb
--- /dev/null
+++ b/MES.Service/Dto/webApi/ErpSalesReturnNoticeDetail.cs
@@ -0,0 +1,33 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+    public class ErpSalesReturnNoticeDetail
+    {
+        public string? Id { get; set; }
+        public string? type { get; set; }
+        public string? erpID { get; set; }
+        public string? ehid { get; set; }
+        public string? fMaterialId { get; set; }
+        public string? fMaterialName { get; set; }
+        public string? fMaterialModel { get; set; }
+        public string? fUnitID { get; set; }
+        public string? fQty { get; set; }
+        public string? fIsFree { get; set; }
+        public string? fDeliverydate { get; set; }
+        public string? fStockId { get; set; }
+        public string? fMtoNo { get; set; }
+        public string? fLot { get; set; }
+        public string? fEntryDescription { get; set; }
+        public string? fRmType { get; set; }
+        public string? fStockUnitID { get; set; }
+        public string? fStockQty { get; set; }
+        public string? fMaterialType { get; set; }
+        public string? fOwnerTypeID { get; set; }
+        public string? fOwnerId { get; set; }
+        public string? fSrcType { get; set; }
+        public string? fSrcBillNo { get; set; }
+        public string? fOrderNo { get; set; }
+       
+
+
+    }
+}
diff --git a/MES.Service/Dto/webApi/SaleDeliveryNotice.cs b/MES.Service/Dto/webApi/SaleDeliveryNotice.cs
new file mode 100644
index 0000000..9f6ca5d
--- /dev/null
+++ b/MES.Service/Dto/webApi/SaleDeliveryNotice.cs
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MES.Service.Dto.webApi
+{
+    public class SaleDeliveryNotice
+    {
+        public ErpSalesDeliveryNotice ErpSalesDeliveryNotice { get; set; }
+        public List<ErpSalesDeliveryNoticeDetail> ErpSalesDeliveryNoticeDetails { get; set; }
+    }
+}
diff --git a/MES.Service/Dto/webApi/SaleReturnNotice.cs b/MES.Service/Dto/webApi/SaleReturnNotice.cs
new file mode 100644
index 0000000..baf803a
--- /dev/null
+++ b/MES.Service/Dto/webApi/SaleReturnNotice.cs
@@ -0,0 +1,9 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+    public class SaleReturnNotice
+    {
+        public ErpSalesReturnNotice erpSalesReturnNotice { get; set; }
+
+        public List<ErpSalesReturnNoticeDetail> erpSalesReturnNoticeDetail { get; set; }
+}
+}
diff --git a/MES.Service/Dto/webApi/SalesOrders.cs b/MES.Service/Dto/webApi/SalesOrders.cs
new file mode 100644
index 0000000..30465fd
--- /dev/null
+++ b/MES.Service/Dto/webApi/SalesOrders.cs
@@ -0,0 +1,9 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+     public class SalesOrders
+    {
+        public ErpSalesOrder ErpSalesOrder { get; set; }
+        public List<ErpSalesOrderDetail> ErpSalesOrderDetails { get; set; }
+
+    }
+}
diff --git a/MES.Service/Modes/SalesDeliveryNotice.cs b/MES.Service/Modes/SalesDeliveryNotice.cs
new file mode 100644
index 0000000..97310b0
--- /dev/null
+++ b/MES.Service/Modes/SalesDeliveryNotice.cs
@@ -0,0 +1,276 @@
+锘縰sing SqlSugar;
+
+namespace MES.Service.Modes;
+
+/// <summary>
+///     閿�鍞彂璐ч�氱煡鍗曡〃
+/// </summary>
+[SugarTable("SALES_DELIVERY_NOTICE")]
+public class SalesDeliveryNotice
+{
+    /// <summary>
+    ///     SEQ_sales搴忓垪
+    /// </summary>
+    [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales",
+        IsPrimaryKey = true)]
+    public decimal Id { get; set; }
+
+    /// <summary>
+    ///     鍗曟嵁绫诲瀷
+    /// </summary>
+    [SugarColumn(ColumnName = "BILL_TYPE")]
+    public string? BillType { get; set; }
+
+    /// <summary>
+    ///     鍗曟嵁缂栧彿
+    /// </summary>
+    [SugarColumn(ColumnName = "BILL_NO")]
+    public string? BillNo { get; set; }
+
+    /// <summary>
+    ///     鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "F_DATE")]
+    public DateTime? FDate { get; set; }
+
+    /// <summary>
+    ///     缁撶畻甯佸埆
+    /// </summary>
+    [SugarColumn(ColumnName = "CURRENCY")]
+    public string? Currency { get; set; }
+
+    /// <summary>
+    ///     閿�鍞粍缁�
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_ORG")]
+    public string? SalesOrg { get; set; }
+
+    /// <summary>
+    ///     閿�鍞儴闂�
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_DEPT")]
+    public string? SalesDept { get; set; }
+
+    /// <summary>
+    ///     瀹㈡埛璁㈠崟
+    /// </summary>
+    [SugarColumn(ColumnName = "CUSTOMER_ORDER_NO")]
+    public string? CustomerOrderNo { get; set; }
+
+    /// <summary>
+    ///     瀹㈡埛
+    /// </summary>
+    [SugarColumn(ColumnName = "CUSTOMER")]
+    public string? Customer { get; set; }
+
+    /// <summary>
+    ///     娣樺疂瀹㈡埛澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "TAOBAO_REMARK")]
+    public string? TaobaoRemark { get; set; }
+
+    /// <summary>
+    ///     浜よ揣鏂瑰紡
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_METHOD")]
+    public string? DeliveryMethod { get; set; }
+
+    /// <summary>
+    ///     浜よ揣鍦扮偣
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_LOCATION")]
+    public string? DeliveryLocation { get; set; }
+
+    /// <summary>
+    ///     鎵胯繍鍟�
+    /// </summary>
+    [SugarColumn(ColumnName = "CARRIER")]
+    public string? Carrier { get; set; }
+
+    /// <summary>
+    ///     杩愯緭鍗曞彿
+    /// </summary>
+    [SugarColumn(ColumnName = "TRANSPORT_NO")]
+    public string? TransportNo { get; set; }
+
+    /// <summary>
+    ///     鍗曟嵁鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "BILL_NO_TYPE")]
+    public string? BillNoType { get; set; }
+
+    /// <summary>
+    ///     鍙戣揣缁勭粐
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_ORG")]
+    public string? DeliveryOrg { get; set; }
+
+    /// <summary>
+    ///     鍙戣揣閮ㄩ棬
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_DEPT")]
+    public string? DeliveryDept { get; set; }
+
+    /// <summary>
+    ///     搴撳瓨缁�
+    /// </summary>
+    [SugarColumn(ColumnName = "INVENTORY_GROUP")]
+    public string? InventoryGroup { get; set; }
+
+    /// <summary>
+    ///     浠撶鍛�
+    /// </summary>
+    [SugarColumn(ColumnName = "WAREHOUSE_MANAGER")]
+    public string? WarehouseManager { get; set; }
+
+    /// <summary>
+    ///     閿�鍞粍
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_GROUP")]
+    public string? SalesGroup { get; set; }
+
+    /// <summary>
+    ///     閿�鍞憳
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_PERSON")]
+    public string? SalesPerson { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂�
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER")]
+    public string? Receiver { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂硅仈绯讳汉
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER_CONTACT")]
+    public string? ReceiverContact { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂瑰湴鍧�
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER_ADDRESS")]
+    public string? ReceiverAddress { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂瑰鍚�
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER_NAME")]
+    public string? ReceiverName { get; set; }
+
+    /// <summary>
+    ///     鑱旂郴鐢佃瘽
+    /// </summary>
+    [SugarColumn(ColumnName = "LINK_PHONE")]
+    public string? LinkPhone { get; set; }
+
+    /// <summary>
+    ///     缁撶畻鏂�
+    /// </summary>
+    [SugarColumn(ColumnName = "SETTLE_PARTY")]
+    public string? SettleParty { get; set; }
+
+    /// <summary>
+    ///     浠樻鏂�
+    /// </summary>
+    [SugarColumn(ColumnName = "PAYER_PARTY")]
+    public string? PayerParty { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATED_BY")]
+    public string? CreatedBy { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓鏃堕棿
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATED_DATE")]
+    public DateTime? CreatedDate { get; set; }
+
+    /// <summary>
+    ///     淇敼浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "MODIFIED_BY")]
+    public string? ModifiedBy { get; set; }
+
+    /// <summary>
+    ///     淇敼鏃堕棿
+    /// </summary>
+    [SugarColumn(ColumnName = "MODIFIED_DATE")]
+    public DateTime? ModifiedDate { get; set; }
+
+    /// <summary>
+    ///     鍏抽棴浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CLOSED_BY")]
+    public string? ClosedBy { get; set; }
+
+    /// <summary>
+    ///     鍏抽棴鍘熷洜
+    /// </summary>
+    [SugarColumn(ColumnName = "CLOSE_REASON")]
+    public string? CloseReason { get; set; }
+
+    /// <summary>
+    ///     鍏抽棴鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "CLOSE_DATE")]
+    public DateTime? CloseDate { get; set; }
+
+    /// <summary>
+    ///     瀹℃牳浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "APPROVED_BY")]
+    public string? ApprovedBy { get; set; }
+
+    /// <summary>
+    ///     瀹℃牳鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "APPROVED_DATE")]
+    public DateTime? ApprovedDate { get; set; }
+
+    /// <summary>
+    ///     浣滃簾鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "CANCEL_STATUS")]
+    public string? CancelStatus { get; set; }
+
+    /// <summary>
+    ///     浣滃簾浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CANCELLED_BY")]
+    public string? CancelledBy { get; set; }
+
+    /// <summary>
+    ///     浣滃簾鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "CANCEL_DATE")]
+    public DateTime? CancelDate { get; set; }
+
+    /// <summary>
+    ///     鍏抽棴鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "CLOSE_STATUS")]
+    public string? CloseStatus { get; set; }
+
+    /// <summary>
+    ///     鏄惁鎵嬪姩鍏抽棴
+    /// </summary>
+    [SugarColumn(ColumnName = "MANUAL_CLOSE_FLAG")]
+    public string? ManualCloseFlag { get; set; }
+
+    /// <summary>
+    ///     ERP澶碔D
+    /// </summary>
+    [SugarColumn(ColumnName = "ERP_ID")]
+    public string? ErpId { get; set; }
+
+    /// <summary>
+    ///     鍗曟嵁鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "BILL_STATUS")]
+    public string? BillStatus { get; set; }
+
+}
diff --git a/MES.Service/Modes/SalesDeliveryNoticeDetail.cs b/MES.Service/Modes/SalesDeliveryNoticeDetail.cs
new file mode 100644
index 0000000..42c9279
--- /dev/null
+++ b/MES.Service/Modes/SalesDeliveryNoticeDetail.cs
@@ -0,0 +1,211 @@
+锘縰sing SqlSugar;
+
+namespace MES.Service.Modes;
+
+/// <summary>
+///     閿�鍞彂璐ч�氱煡鍗曟槑缁嗚〃
+/// </summary>
+[SugarTable("SALES_DELIVERY_NOTICE_DETAIL")]
+public class SalesDeliveryNoticeDetail
+{
+    /// <summary>
+    ///     SEQ_sales搴忓垪
+    /// </summary>
+    [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales",
+        IsPrimaryKey = true)]
+    public decimal Id { get; set; }
+
+    /// <summary>
+    ///     閿�鍞鍗曞彿
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_ORDER_ID")]
+    public string? SalesOrderId { get; set; }
+
+    /// <summary>
+    ///     鐗╂枡缂栫爜
+    /// </summary>
+    [SugarColumn(ColumnName = "MATERIAL_ID")]
+    public string? MaterialId { get; set; }
+
+    /// <summary>
+    ///     鐗╂枡鍚嶇О
+    /// </summary>
+    [SugarColumn(ColumnName = "MATERIAL_NAME")]
+    public string? MaterialName { get; set; }
+
+    /// <summary>
+    ///     鐗╂枡瑙勬牸
+    /// </summary>
+    [SugarColumn(ColumnName = "MATERIAL_SPECIFICATION")]
+    public string? MaterialSpecification { get; set; }
+
+    /// <summary>
+    ///     閿�鍞崟浣�
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_UNIT_ID")]
+    public string? SalesUnitId { get; set; }
+
+    /// <summary>
+    ///     閿�鍞暟閲�
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_QUANTITY")]
+    public decimal? SalesQuantity { get; set; }
+
+    /// <summary>
+    ///     鏄惁璧犲搧
+    /// </summary>
+    [SugarColumn(ColumnName = "IS_FREE")]
+    public string? IsFree { get; set; }
+
+    /// <summary>
+    ///     瑕佽揣鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_DATE")]
+    public DateTime? DeliveryDate { get; set; }
+
+    /// <summary>
+    ///     鍑鸿揣浠撳簱
+    /// </summary>
+    [SugarColumn(ColumnName = "WAREHOUSE")]
+    public string? WareHouse { get; set; }
+
+    /// <summary>
+    ///     璁″垝璺熻釜鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "PLAN_TRACKING_NUMBER")]
+    public string? PlanTrackingNumber { get; set; }
+
+    /// <summary>
+    ///     鎵瑰彿
+    /// </summary>
+    [SugarColumn(ColumnName = "LOT_NUMBER")]
+    public string? LotNumber { get; set; }
+
+    /// <summary>
+    ///     婧愬崟缂栧彿
+    /// </summary>
+    [SugarColumn(ColumnName = "SRC_BILL_NO")]
+    public string? SrcBillNo { get; set; }
+
+    /// <summary>
+    ///     璁′环鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "PRICE_QTY")]
+    public decimal? PriceQty { get; set; }
+
+    /// <summary>
+    ///     璐т富
+    /// </summary>
+    [SugarColumn(ColumnName = "OWNER_ID")]
+    public string? OwnerId { get; set; }
+
+    /// <summary>
+    ///     搴撳瓨鍗曚綅
+    /// </summary>
+    [SugarColumn(ColumnName = "INVENTORY_UNIT")]
+    public string? InventoryUnit { get; set; }
+
+    /// <summary>
+    ///     搴撳瓨鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "INVENTORY_QUANTITY")]
+    public decimal? InventoryQuantity { get; set; }
+
+    /// <summary>
+    ///     鐗╂枡绫诲埆
+    /// </summary>
+    [SugarColumn(ColumnName = "MATERIAL_CATEGORY")]
+    public string? MaterialCategory { get; set; }
+
+    /// <summary>
+    ///     璁″垝鍙戣揣鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "PLAN_DELIVERY_DATE")]
+    public DateTime? PlanDeliveryDate { get; set; }
+
+    /// <summary>
+    ///     瓒呭彂鎺у埗鍗曚綅
+    /// </summary>
+    [SugarColumn(ColumnName = "OUT_LMT_UNIT")]
+    public string? OutLmtUnit { get; set; }
+
+    /// <summary>
+    ///     鍑哄簱涓婇檺
+    /// </summary>
+    [SugarColumn(ColumnName = "OUT_MAX_QTY")]
+    public decimal? OutMaxQty { get; set; }
+
+    /// <summary>
+    ///     鍑哄簱涓嬮檺
+    /// </summary>
+    [SugarColumn(ColumnName = "OUT_MIN_QTY")]
+    public decimal? OutMinQty { get; set; }
+
+    /// <summary>
+    ///     浜よ揣鍦扮偣
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_LOC")]
+    public string? DeliveryLoc { get; set; }
+
+    /// <summary>
+    ///     浜よ揣鍦板潃
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERYL_ADDRESS")]
+    public string? DeliveryAddress { get; set; }
+
+    /// <summary>
+    ///     婧愬崟鍗曞彿
+    /// </summary>
+    [SugarColumn(ColumnName = "SOURCE_BILL_NO")]
+    public string? SourceBillNo { get; set; }
+
+    /// <summary>
+    ///     璁㈠崟鍗曞彿
+    /// </summary>
+    [SugarColumn(ColumnName = "ORDER_BILL_NO")]
+    public string? OrderBillNo { get; set; }
+
+    /// <summary>
+    ///     缁堟鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "TERMINATION_STATUS")]
+    public string? TerminationStatus { get; set; }
+
+    /// <summary>
+    ///     缁堟鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "TERMINATION_DATE")]
+    public DateTime? TerminationDate { get; set; }
+
+    /// <summary>
+    ///     绱鍑哄簱鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "SUM_OUT_QTY")]
+    public decimal? SumOutQty { get; set; }
+
+    /// <summary>
+    ///     鏈嚭搴撴暟閲�
+    /// </summary>
+    [SugarColumn(ColumnName = "REMAIN_OUT_QTY")]
+    public decimal? RemainOutQty { get; set; }
+
+    /// <summary>
+    ///     ERPID
+    /// </summary>
+    [SugarColumn(ColumnName = "ERP_LINE_ID")]
+    public string ErpLineId { get; set; }
+
+    /// <summary>
+    ///     ERP澶碔D
+    /// </summary>
+    [SugarColumn(ColumnName = "ERP_HEAD_ID")]
+    public string ErpHeadId { get; set; }
+
+    /// <summary>
+    ///     澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "FENTRYNOTE")]
+    public string FentryNote { get; set; }
+
+}
+
diff --git a/MES.Service/Modes/SalesOrder.cs b/MES.Service/Modes/SalesOrder.cs
index 304b4ec..ac1756f 100644
--- a/MES.Service/Modes/SalesOrder.cs
+++ b/MES.Service/Modes/SalesOrder.cs
@@ -16,98 +16,195 @@
     public decimal Id { get; set; }
 
     /// <summary>
-    ///     璁㈠崟鍗曞彿
+    ///     ERP澶碔D
     /// </summary>
-    [SugarColumn(ColumnName = "ORDER_ID")]
-    public string OrderId { get; set; }
+    [SugarColumn(ColumnName = "ERP_ID")]
+    public decimal? ErpId { get; set; }
 
     /// <summary>
-    ///     璁㈠崟鍗曞埆
+    ///     鍗曟嵁缂栧彿
     /// </summary>
-    [SugarColumn(ColumnName = "ORDER_TYPE")]
-    public string OrderType { get; set; }
+    [SugarColumn(ColumnName = "BILL_NO")]
+    public string? BillNo { get; set; }
 
     /// <summary>
-    ///     鍙楄鏃ユ湡
+    ///     鍗曟嵁绫诲瀷
     /// </summary>
-    [SugarColumn(ColumnName = "ORDER_DATE")]
-    public DateTime? OrderDate { get; set; }
+    [SugarColumn(ColumnName = "BILL_TYPE_ID")]
+    public string? BillTypeId { get; set; }
 
     /// <summary>
-    ///     鍗曟嵁鐗堟湰
+    ///     鍗曟嵁鐘舵��
     /// </summary>
-    [SugarColumn(ColumnName = "DOCUMENT_VERSION")]
-    public long? DocumentVersion { get; set; }
+    [SugarColumn(ColumnName = "DOCUMENT_STATUS")]
+    public string? DocumentStatus { get; set; }
 
     /// <summary>
-    ///     鍗曟嵁鏃ユ湡
+    ///     鏃ユ湡
     /// </summary>
-    [SugarColumn(ColumnName = "DOCUMENT_DATE")]
-    public DateTime? DocumentDate { get; set; }
+    [SugarColumn(ColumnName = "F_DATE")]
+    public DateTime? FDate { get; set; }
 
     /// <summary>
-    ///     宸ュ巶缂栧彿
+    ///     涓氬姟绫诲瀷
     /// </summary>
-    [SugarColumn(ColumnName = "FACTORY_ID")]
-    public string FactoryId { get; set; }
+    [SugarColumn(ColumnName = "BUSINESS_TYPE")]
+    public string? BusinessType { get; set; }
 
     /// <summary>
-    ///     宸ュ巶绠�绉�
+    ///     浜よ揣鏂瑰紡
     /// </summary>
-    [SugarColumn(ColumnName = "FACTORY_NAME")]
-    public string FactoryName { get; set; }
+    [SugarColumn(ColumnName = "HEAD_DELIVERY_WAY")]
+    public string? HeadDeliveryWay { get; set; }
 
     /// <summary>
-    ///     瀹㈡埛缂栧彿
+    ///     浜よ揣鍦扮偣
     /// </summary>
-    [SugarColumn(ColumnName = "CUSTOMER_ID")]
-    public string CustomerId { get; set; }
+    [SugarColumn(ColumnName = "HEAD_LOC_ID")]
+    public string? HeadLocId { get; set; }
 
     /// <summary>
-    ///     瀹㈡埛绠�绉�
+    ///     瀹㈡埛
     /// </summary>
-    [SugarColumn(ColumnName = "CUSTOMER_NAME")]
-    public string CustomerName { get; set; }
+    [SugarColumn(ColumnName = "CUST_ID")]
+    public string? CustId { get; set; }
 
     /// <summary>
-    ///     瀹㈡埛鍗曞彿
+    ///     鍏抽棴鐘舵��
     /// </summary>
-    [SugarColumn(ColumnName = "CUSTOMER_ORDER_ID")]
-    public string CustomerOrderId { get; set; }
+    [SugarColumn(ColumnName = "CLOSE_STATUS")]
+    public string? CloseStatus { get; set; }
 
     /// <summary>
-    ///     閮ㄩ棬缂栧彿
+    ///     閿�鍞儴闂�
     /// </summary>
-    [SugarColumn(ColumnName = "DEPARTMENT_ID")]
-    public string DepartmentId { get; set; }
+    [SugarColumn(ColumnName = "SALE_DEPT_ID")]
+    public string? SaleDeptId { get; set; }
 
     /// <summary>
-    ///     鎬绘暟閲�
+    ///     閿�鍞憳
     /// </summary>
-    [SugarColumn(ColumnName = "TOTAL_QUANTITY")]
-    public decimal? TotalQuantity { get; set; }
+    [SugarColumn(ColumnName = "SALER_ID")]
+    public string? SalerId { get; set; }
+
+    /// <summary>
+    ///     鍙樻洿鍘熷洜
+    /// </summary>
+    [SugarColumn(ColumnName = "CHANGE_REASON")]
+    public string? ChangeReason { get; set; }
 
     /// <summary>
     ///     澶囨敞
     /// </summary>
-    [SugarColumn(ColumnName = "REMARKS")]
-    public string Remarks { get; set; }
+    [SugarColumn(ColumnName = "NOTE")]
+    public string? Note { get; set; }
+
+    /// <summary>
+    ///     缁撶畻鏂�
+    /// </summary>
+    [SugarColumn(ColumnName = "SETTLE_ID")]
+    public string? SettleId { get; set; }
+
+    /// <summary>
+    ///     erp瀹℃牳浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "APPROVER_ID")]
+    public string? ApproverId { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣浜哄鍚�
+    /// </summary>
+    [SugarColumn(ColumnName = "LINK_MAN")]
+    public string? LinkMan { get; set; }
+
+    /// <summary>
+    ///     浠樻鏂�
+    /// </summary>
+    [SugarColumn(ColumnName = "CHARGE_ID")]
+    public string? ChargeId { get; set; }
+
+    /// <summary>
+    ///     鑱旂郴鐢佃瘽
+    /// </summary>
+    [SugarColumn(ColumnName = "LINK_PHONE")]
+    public string? LinkPhone { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATOR_ID")]
+    public string? CreatorId { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATE_DATE")]
+    public DateTime? CreateDate { get; set; }
+
+    /// <summary>
+    ///     鏈�鍚庝慨鏀逛汉
+    /// </summary>
+    [SugarColumn(ColumnName = "MODIFIER_ID")]
+    public string? ModifierId { get; set; }
+
+    /// <summary>
+    ///     鏈�鍚庝慨鏀规棩鏈�
+    /// </summary>
+    [SugarColumn(ColumnName = "MODIFY_DATE")]
+    public DateTime? ModifyDate { get; set; }
 
     /// <summary>
     ///     erp瀹℃牳鏃ユ湡
     /// </summary>
-    [SugarColumn(ColumnName = "APPROVAL_DATE")]
-    public DateTime? ApprovalDate { get; set; }
+    [SugarColumn(ColumnName = "APPROVE_DATE")]
+    public DateTime? ApproveDate { get; set; }
 
     /// <summary>
-    ///     erp瀹℃牳鑰�
+    ///     鍏抽棴浜�
     /// </summary>
-    [SugarColumn(ColumnName = "APPROVER")]
-    public string Approver { get; set; }
+    [SugarColumn(ColumnName = "CLOSER_ID")]
+    public string? CloserId { get; set; }
 
     /// <summary>
-    ///     ERPID
+    ///     鍏抽棴鏃ユ湡
     /// </summary>
-    [SugarColumn(ColumnName = "ERP_ID")]
-    public string ErpId { get; set; }
+    [SugarColumn(ColumnName = "CLOSE_DATE")]
+    public DateTime? CloseDate { get; set; }
+
+    /// <summary>
+    ///     鍙樻洿鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "CHANGE_DATE")]
+    public DateTime? ChangeDate { get; set; }
+
+    /// <summary>
+    ///     浣滃簾鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "CANCEL_STATUS")]
+    public string? CancelStatus { get; set; }
+
+    /// <summary>
+    ///     浣滃簾浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CANCELLER_ID")]
+    public string? CancellerId { get; set; }
+
+    /// <summary>
+    ///     鐗堟湰鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "VERSION_NO")]
+    public decimal? VersionNo { get; set; }
+
+    /// <summary>
+    ///     鍙樻洿浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CHANGER_ID")]
+    public string? ChangerId { get; set; }
+
+    /// <summary>
+    ///     澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "ENTRY_NOTE")]
+    public string? EntryNote { get; set; }
+
 }
\ No newline at end of file
diff --git a/MES.Service/Modes/SalesOrderDetail.cs b/MES.Service/Modes/SalesOrderDetail.cs
index 0dd800e..9ce0c26 100644
--- a/MES.Service/Modes/SalesOrderDetail.cs
+++ b/MES.Service/Modes/SalesOrderDetail.cs
@@ -16,98 +16,195 @@
     public decimal Id { get; set; }
 
     /// <summary>
-    ///     璁㈠崟鍗曞彿
-    /// </summary>
-    [SugarColumn(ColumnName = "ORDER_ID")]
-    public string OrderId { get; set; }
-
-    /// <summary>
-    ///     搴忓彿
-    /// </summary>
-    [SugarColumn(ColumnName = "LINE_NUMBER")]
-    public long? LineNumber { get; set; }
-
-    /// <summary>
-    ///     浜у搧缂栫爜
-    /// </summary>
-    [SugarColumn(ColumnName = "PRODUCT_CODE")]
-    public string ProductCode { get; set; }
-
-    /// <summary>
-    ///     浜у搧鍚嶇О
-    /// </summary>
-    [SugarColumn(ColumnName = "PRODUCT_NAME")]
-    public string ProductName { get; set; }
-
-    /// <summary>
-    ///     浜у搧瑙勬牸
-    /// </summary>
-    [SugarColumn(ColumnName = "PRODUCT_SPEC")]
-    public string ProductSpec { get; set; }
-
-    /// <summary>
-    ///     棰勪氦璐ф棩鏈�
-    /// </summary>
-    [SugarColumn(ColumnName = "SCHEDULED_DELIVERY_DATE")]
-    public DateTime? ScheduledDeliveryDate { get; set; }
-
-    /// <summary>
-    ///     璁㈠崟鏁伴噺
-    /// </summary>
-    [SugarColumn(ColumnName = "ORDER_QUANTITY")]
-    public decimal? OrderQuantity { get; set; }
-
-    /// <summary>
-    ///     鍗曚綅
-    /// </summary>
-    [SugarColumn(ColumnName = "UNIT")]
-    public string Unit { get; set; }
-
-    /// <summary>
-    ///     鍗曚环
-    /// </summary>
-    [SugarColumn(ColumnName = "UNIT_PRICE")]
-    public decimal? UnitPrice { get; set; }
-
-    /// <summary>
-    ///     閲戦
-    /// </summary>
-    [SugarColumn(ColumnName = "AMOUNT")]
-    public decimal? Amount { get; set; }
-
-    /// <summary>
-    ///     瀹㈡埛浜у搧缂栫爜
-    /// </summary>
-    [SugarColumn(ColumnName = "CUSTOMER_PRODUCT_CODE")]
-    public string CustomerProductCode { get; set; }
-
-    /// <summary>
-    ///     宸蹭氦璐ф暟
-    /// </summary>
-    [SugarColumn(ColumnName = "DELIVERED_QUANTITY")]
-    public decimal? DeliveredQuantity { get; set; }
-
-    /// <summary>
-    ///     缁撴潫
-    /// </summary>
-    [SugarColumn(ColumnName = "IS_CLOSED")]
-    public string IsClosed { get; set; }
-
-    /// <summary>
-    ///     澶囨敞
-    /// </summary>
-    [SugarColumn(ColumnName = "REMARKS")]
-    public string Remarks { get; set; }
-
-    /// <summary>
-    ///     ERPID
+    ///     ERP琛孖D
     /// </summary>
     [SugarColumn(ColumnName = "ERP_ID")]
-    public string ErpId { get; set; }
+    public decimal? ErpId { get; set; }
 
     /// <summary>
     ///     ERP澶碔D
     /// </summary>
-    [SugarColumn(ColumnName = "ERP_HEAD_ID")]
-    public string ErpHeadId { get; set; }
+    [SugarColumn(ColumnName = "E_HID")]
+    public decimal? EHid { get; set; }
+
+    /// <summary>
+    ///     鐗╂枡缂栫爜
+    /// </summary>
+    [SugarColumn(ColumnName = "MATERIAL_ID")]
+    public string? MaterialIDd{ get; set; }
+
+    /// <summary>
+    ///     閿�鍞崟浣�
+    /// </summary>
+    [SugarColumn(ColumnName = "UNIT_ID")]
+    public string? UnitId { get; set; }
+
+    /// <summary>
+    ///     閿�鍞暟閲�
+    /// </summary>
+    [SugarColumn(ColumnName = "QTY")]
+    public decimal? Qty { get; set; }
+
+    /// <summary>
+    ///     璁′环鍗曚綅
+    /// </summary>
+    [SugarColumn(ColumnName = "PRICE_UNIT_ID")]
+    public string? PriceUnitId { get; set; }
+
+    /// <summary>
+    ///     璁′环鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "PRICE_UNIT_QTY")]
+    public decimal? PriceUnitQty { get; set; }
+
+    /// <summary>
+    ///     瑕佽揣鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_DATE")]
+    public DateTime? DeliveryDate { get; set; }
+
+    /// <summary>
+    ///     鏄惁璧犲搧
+    /// </summary>
+    [SugarColumn(ColumnName = "IS_FREE")]
+    public string? IsFree { get; set; }
+
+    /// <summary>
+    ///     璐т富绫诲瀷
+    /// </summary>
+    [SugarColumn(ColumnName = "OWNER_TYPE_ID")]
+    public string? OwnerTypeId { get; set; }
+
+    /// <summary>
+    ///     璐т富
+    /// </summary>
+    [SugarColumn(ColumnName = "OWNER_ID")]
+    public string? OwnerId { get; set; }
+
+    /// <summary>
+    ///     澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "ENTRY_NOTE")]
+    public string? EntryNote { get; set; }
+
+    /// <summary>
+    ///     璁″垝璺熻釜鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "MTO_NO")]
+    public string? MtoNo { get; set; }
+
+    /// <summary>
+    ///     鎵瑰彿
+    /// </summary>
+    [SugarColumn(ColumnName = "LOT")]
+    public string? Lot { get; set; }
+
+    /// <summary>
+    ///     鍙戣揣涓婇檺
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_MAX_QTY")]
+    public decimal? DeliveryMaxQty { get; set; }
+
+    /// <summary>
+    ///     鍙戣揣涓嬮檺
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_MIN_QTY")]
+    public decimal? DeliveryMinQty { get; set; }
+
+    /// <summary>
+    ///     瓒呭彂鎺у埗鍗曚綅
+    /// </summary>
+    [SugarColumn(ColumnName = "OUT_LMT_UNIT_ID")]
+    public string? OutLmtUnitId { get; set; }
+
+    /// <summary>
+    ///     涓氬姟鍏抽棴
+    /// </summary>
+    [SugarColumn(ColumnName = "MRP_CLOSE_STATUS")]
+    public string? MrpCloseStatus { get; set; }
+
+    /// <summary>
+    ///     涓氬姟缁堟
+    /// </summary>
+    [SugarColumn(ColumnName = "MRP_TERMINATE_STATUS")]
+    public string? MrpTerminateStatus { get; set; }
+
+    /// <summary>
+    ///     缁堟鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "TERMINATE_DATE")]
+    public DateTime? TerminateDate { get; set; }
+
+    /// <summary>
+    ///     缁堟浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "TERMINATER_ID")]
+    public string? TerminaterId { get; set; }
+
+    /// <summary>
+    ///     婧愬崟绫诲瀷
+    /// </summary>
+    [SugarColumn(ColumnName = "SRC_TYPE")]
+    public string? SrcType { get; set; }
+
+    /// <summary>
+    ///     婧愬崟鍗曞彿
+    /// </summary>
+    [SugarColumn(ColumnName = "SRC_BILL_NO")]
+    public string? SrcBillNo { get; set; }
+
+    /// <summary>
+    ///     绱鍙戣揣閫氱煡鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "DELI_QTY")]
+    public decimal? DeliQty { get; set; }
+
+    /// <summary>
+    ///     绱鍑哄簱鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "STOCK_OUT_QTY")]
+    public decimal? StockOutQty { get; set; }
+
+    /// <summary>
+    ///     绱閫�璐ч�氱煡鏁伴噺锛堥攢鍞熀鏈級
+    /// </summary>
+    [SugarColumn(ColumnName = "BASE_RET_NOTICE_QTY")]
+    public decimal? BaseRetNoticeQty { get; set; }
+
+    /// <summary>
+    ///     绱閫�璐ф暟閲忥紙閿�鍞熀鏈級
+    /// </summary>
+    [SugarColumn(ColumnName = "BASE_RETURN_QTY")]
+    public decimal? BaseReturnQty { get; set; }
+
+    /// <summary>
+    ///     鍓╀綑鏈嚭鏁伴噺锛堥攢鍞熀鏈級
+    /// </summary>
+    [SugarColumn(ColumnName = "BASE_REMAIN_OUT_QTY")]
+    public decimal? BaseRemainOutQty { get; set; }
+
+    /// <summary>
+    ///     绱搴旀敹鏁伴噺锛堥攢鍞熀鏈級
+    /// </summary>
+    [SugarColumn(ColumnName = "BASEARQTY")]
+    public decimal? BaseArQty { get; set; }
+
+    /// <summary>
+    ///     瀹㈡埛鐗╂枡缂栫爜
+    /// </summary>
+    [SugarColumn(ColumnName = "CUST_INO")]
+    public string? CustIno { get; set; }
+
+    /// <summary>
+    ///     瀹㈡埛鐗╂枡鍚嶇О
+    /// </summary>
+    [SugarColumn(ColumnName = "CUST_INM")]
+    public string? CustInm { get; set; }
+
+    /// <summary>
+    ///     瀹㈡埛鐗╂枡瑙勬牸
+    /// </summary>
+    [SugarColumn(ColumnName = "CUST_IMD")]
+    public string? CustImd { get; set; }
+
 }
\ No newline at end of file
diff --git a/MES.Service/Modes/SalesReturnNotice.cs b/MES.Service/Modes/SalesReturnNotice.cs
index f3c462d..87131a5 100644
--- a/MES.Service/Modes/SalesReturnNotice.cs
+++ b/MES.Service/Modes/SalesReturnNotice.cs
@@ -16,68 +16,243 @@
     public decimal Id { get; set; }
 
     /// <summary>
-    ///     鍒跺崟浜�
+    ///     鍗曟嵁绫诲瀷
     /// </summary>
-    [SugarColumn(ColumnName = "CREATED_BY")]
-    public string CreatedBy { get; set; }
+    [SugarColumn(ColumnName = "BILL_TYPE")]
+    public string? BillType { get; set; }
 
     /// <summary>
     ///     鍗曟嵁缂栧彿
     /// </summary>
-    [SugarColumn(ColumnName = "DOCUMENT_ID")]
-    public string DocumentId { get; set; }
+    [SugarColumn(ColumnName = "BILL_NO")]
+    public string? BillNo { get; set; }
 
     /// <summary>
-    ///     瀹℃牳浜哄悕绉�
+    ///     鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "F_DATE")]
+    public DateTime? FDate { get; set; }
+
+    /// <summary>
+    ///     缁撶畻甯佸埆
+    /// </summary>
+    [SugarColumn(ColumnName = "CURRENCY")]
+    public string? Currency { get; set; }
+
+    /// <summary>
+    ///     閿�鍞粍缁�
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_ORG")]
+    public string? SalesOrg { get; set; }
+
+    /// <summary>
+    ///     閿�鍞儴闂�
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_DEPT")]
+    public string? SalesDept { get; set; }
+
+    /// <summary>
+    ///     瀹㈡埛璁㈠崟
+    /// </summary>
+    [SugarColumn(ColumnName = "CUSTOMER_ORDER_NO")]
+    public string? CustomerOrderNo { get; set; }
+
+    /// <summary>
+    ///     閫�璐у鎴�
+    /// </summary>
+    [SugarColumn(ColumnName = "RETURN_CUSTOMER")]
+    public string? ReturnCustomer { get; set; }
+
+    /// <summary>
+    ///     娣樺疂瀹㈡埛澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "TAOBAO_REMARK")]
+    public string? TaobaoRemark { get; set; }
+
+    /// <summary>
+    ///     閫�璐у師鍥�
+    /// </summary>
+    [SugarColumn(ColumnName = "RETURN_REASON")]
+    public string? ReturnReason { get; set; }
+
+    /// <summary>
+    ///     浜よ揣鍦扮偣
+    /// </summary>
+    [SugarColumn(ColumnName = "DELIVERY_LOCATION")]
+    public string? DeliveryLocation { get; set; }
+
+    /// <summary>
+    ///     搴撳瓨缁勭粐
+    /// </summary>
+    [SugarColumn(ColumnName = "INVENTORY_ORG")]
+    public string? InventoryOrg { get; set; }
+
+    /// <summary>
+    ///     搴撳瓨閮ㄩ棬
+    /// </summary>
+    [SugarColumn(ColumnName = "INVENTORY_DEPT")]
+    public string? InventoryDept { get; set; }
+
+    /// <summary>
+    ///     搴撳瓨缁�
+    /// </summary>
+    [SugarColumn(ColumnName = "INVENTORY_GROUP")]
+    public string? InventoryGroup  { get; set; }
+
+    /// <summary>
+    ///     浠撶鍛�
+    /// </summary>
+    [SugarColumn(ColumnName = "WAREHOUSE_MANAGER")]
+    public string? WarehouseManager { get; set; }
+
+    /// <summary>
+    ///     閿�鍞粍
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_GROUP")]
+    public string? SalesGroup { get; set; }
+
+    /// <summary>
+    ///     閿�鍞憳
+    /// </summary>
+    [SugarColumn(ColumnName = "SALES_PERSON")]
+    public string? SalesPerson { get; set; }
+
+    /// <summary>
+    ///     蹇�掑崟鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "EXPRESS_NO")]
+    public string? ExpressNo { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂�
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER")]
+    public string? Receiver { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂硅仈绯讳汉
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER_CONTACT")]
+    public string? ReceiverContact { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂瑰湴鍧�
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER_ADDRESS")]
+    public string? ReceiverAddress { get; set; }
+
+    /// <summary>
+    ///     鏀惰揣鏂瑰鍚�
+    /// </summary>
+    [SugarColumn(ColumnName = "RECEIVER_NAME")]
+    public string? ReceiverName { get; set; }
+
+    /// <summary>
+    ///     缁撶畻鏂�
+    /// </summary>
+    [SugarColumn(ColumnName = "SETTLE_PARTY")]
+    public string? SettleParty { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATED_BY")]
+    public string? CreatedBy { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓鏃堕棿
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATED_DATE")]
+    public DateTime? CreatedDate { get; set; }
+
+    /// <summary>
+    ///     淇敼浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "MODIFIED_BY")]
+    public string? ModifiedBy { get; set; }
+
+    /// <summary>
+    ///     淇敼鏃堕棿
+    /// </summary>
+    [SugarColumn(ColumnName = "MODIFIED_DATE")]
+    public DateTime? ModifiedDate { get; set; }
+
+    /// <summary>
+    ///     鍏抽棴浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CLOSED_BY")]
+    public string? ClosedBy { get; set; }
+
+    /// <summary>
+    ///     鍏抽棴鍘熷洜
+    /// </summary>
+    [SugarColumn(ColumnName = "CLOSE_REASON")]
+    public string? CloseReason { get; set; }
+
+    /// <summary>
+    ///     鍏抽棴鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "CLOSE_DATE")]
+    public DateTime? CloseDate { get; set; }
+
+    /// <summary>
+    ///     瀹℃牳浜�
     /// </summary>
     [SugarColumn(ColumnName = "APPROVED_BY")]
-    public string ApprovedBy { get; set; }
+    public string? ApprovedBy { get; set; }
 
     /// <summary>
-    ///     鍒跺崟/瀹℃牳鏃ユ湡
+    ///     瀹℃牳鏃ユ湡
     /// </summary>
-    [SugarColumn(ColumnName = "CREATED_OR_APPROVED_DATE")]
-    public DateTime? CreatedOrApprovedDate { get; set; }
+    [SugarColumn(ColumnName = "APPROVED_DATE")]
+    public DateTime? ApprovedDate { get; set; }
 
     /// <summary>
-    ///     閮ㄩ棬浠g爜
+    ///     浣滃簾鐘舵��
     /// </summary>
-    [SugarColumn(ColumnName = "DEPARTMENT_CODE")]
-    public string DepartmentCode { get; set; }
+    [SugarColumn(ColumnName = "CANCEL_STATUS")]
+    public string? CancelStatus { get; set; }
 
     /// <summary>
-    ///     閮ㄩ棬鍚嶇О
+    ///     浣滃簾浜�
     /// </summary>
-    [SugarColumn(ColumnName = "DEPARTMENT_NAME")]
-    public string DepartmentName { get; set; }
+    [SugarColumn(ColumnName = "CANCELLED_BY")]
+    public string? CancelledBy { get; set; }
 
     /// <summary>
-    ///     璐揣鍗曚綅浠g爜
+    ///     浣滃簾鏃ユ湡
     /// </summary>
-    [SugarColumn(ColumnName = "PURCHASER_CODE")]
-    public string PurchaserCode { get; set; }
+    [SugarColumn(ColumnName = "CANCEL_DATE")]
+    public DateTime? CancelDate { get; set; }
 
     /// <summary>
-    ///     璐揣鍗曚綅鍚嶇О
+    ///     鍏抽棴鐘舵��
     /// </summary>
-    [SugarColumn(ColumnName = "PURCHASER_NAME")]
-    public string PurchaserName { get; set; }
+    [SugarColumn(ColumnName = "CLOSE_STATUS")]
+    public string? CloseStatus { get; set; }
 
     /// <summary>
-    ///     涓氬姟鍛樹唬鐮�
+    ///     鏄惁鎵嬪姩鍏抽棴
     /// </summary>
-    [SugarColumn(ColumnName = "SALESPERSON_CODE")]
-    public string SalespersonCode { get; set; }
+    [SugarColumn(ColumnName = "MANUAL_CLOSE_FLAG")]
+    public string? ManualCloseFlag { get; set; }
 
     /// <summary>
-    ///     涓氬姟鍛樺悕绉�
-    /// </summary>
-    [SugarColumn(ColumnName = "SALESPERSON_NAME")]
-    public string SalespersonName { get; set; }
-
-    /// <summary>
-    ///     ERPID
+    ///     ERP澶碔D
     /// </summary>
     [SugarColumn(ColumnName = "ERP_ID")]
-    public string ErpId { get; set; }
+    public string? ErpId { get; set; }
+
+    /// <summary>
+    ///     鍗曟嵁鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "BILL_STATUS")]
+    public string? BillStatus { get; set; }
+
+
+    /// <summary>
+    ///     閫�璐у師鍥�
+    /// </summary>
+    [SugarColumn(ColumnName = "FUNWTEXTTHYY")]
+    public string? Funwtextthyy { get; set; }
 }
\ No newline at end of file
diff --git a/MES.Service/Modes/SalesReturnNoticeDetail.cs b/MES.Service/Modes/SalesReturnNoticeDetail.cs
index 3d64ef4..5005314 100644
--- a/MES.Service/Modes/SalesReturnNoticeDetail.cs
+++ b/MES.Service/Modes/SalesReturnNoticeDetail.cs
@@ -16,136 +16,142 @@
     public decimal Id { get; set; }
 
     /// <summary>
-    ///     鍗曟嵁琛屽彿
+    ///     閿�鍞鍗曞彿
     /// </summary>
-    [SugarColumn(ColumnName = "LINE_NUMBER")]
-    public long? LineNumber { get; set; }
+    [SugarColumn(ColumnName = "SALES_ORDER_ID")]
+    public string? SalesOrderId { get; set; }
 
     /// <summary>
-    ///     浜у搧浠g爜
+    ///     鐗╂枡缂栫爜
     /// </summary>
-    [SugarColumn(ColumnName = "PRODUCT_CODE")]
-    public string ProductCode { get; set; }
+    [SugarColumn(ColumnName = "MATERIAL_ID")]
+    public string? MaterialId { get; set; }
 
     /// <summary>
-    ///     浜у搧鍚嶇О
+    ///     鐗╂枡鍚嶇О
     /// </summary>
-    [SugarColumn(ColumnName = "PRODUCT_NAME")]
-    public string ProductName { get; set; }
+    [SugarColumn(ColumnName = "MATERIAL_NAME")]
+    public string? MaterialName { get; set; }
 
     /// <summary>
-    ///     浜у搧瑙勬牸
+    ///     鐗╂枡瑙勬牸
     /// </summary>
-    [SugarColumn(ColumnName = "PRODUCT_SPEC")]
-    public string ProductSpec { get; set; }
+    [SugarColumn(ColumnName = "MATERIAL_SPECIFICATION")]
+    public string? MaterialSpecification { get; set; }
 
     /// <summary>
-    ///     閲戦
+    ///     閿�鍞崟浣�
     /// </summary>
-    [SugarColumn(ColumnName = "AMOUNT")]
-    public decimal? Amount { get; set; }
+    [SugarColumn(ColumnName = "SALES_UNIT_ID")]
+    public string? SalesUnitId { get; set; }
 
     /// <summary>
-    ///     鍗曚环
+    ///     閿�鍞暟閲�
     /// </summary>
-    [SugarColumn(ColumnName = "UNIT_PRICE")]
-    public decimal? UnitPrice { get; set; }
+    [SugarColumn(ColumnName = "SALES_QUANTITY")]
+    public decimal? SalesQuantity { get; set; }
 
     /// <summary>
-    ///     鏁伴噺
+    ///     鏄惁璧犲搧
     /// </summary>
-    [SugarColumn(ColumnName = "QUANTITY")]
-    public decimal? Quantity { get; set; }
+    [SugarColumn(ColumnName = "IS_FREE")]
+    public string? IsFree { get; set; }
 
     /// <summary>
-    ///     鍑哄簱鏁伴噺
+    ///     閫�璐ф棩鏈�
     /// </summary>
-    [SugarColumn(ColumnName = "OUT_QUANTITY")]
-    public decimal? OutQuantity { get; set; }
+    [SugarColumn(ColumnName = "RETURN_DATE")]
+    public DateTime? ReturnDate { get; set; }
+
+    /// <summary>
+    ///     浠撳簱
+    /// </summary>
+    [SugarColumn(ColumnName = "WAREHOUSE")]
+    public string? WareHouse { get; set; }
+
+    /// <summary>
+    ///     璁″垝璺熻釜鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "PLAN_TRACKING_NUMBER")]
+    public string? PlanTrackingNumber { get; set; }
 
     /// <summary>
     ///     鎵瑰彿
     /// </summary>
-    [SugarColumn(ColumnName = "BATCH_NUMBER")]
-    public string BatchNumber { get; set; }
-
-    /// <summary>
-    ///     閫�璐ф暟閲�
-    /// </summary>
-    [SugarColumn(ColumnName = "RETURN_QUANTITY")]
-    public decimal? ReturnQuantity { get; set; }
-
-    /// <summary>
-    ///     鍙戣揣鏁伴噺
-    /// </summary>
-    [SugarColumn(ColumnName = "DELIVERY_QUANTITY")]
-    public decimal? DeliveryQuantity { get; set; }
+    [SugarColumn(ColumnName = "LOT_NUMBER")]
+    public string? LotNumber { get; set; }
 
     /// <summary>
     ///     澶囨敞
     /// </summary>
-    [SugarColumn(ColumnName = "REMARKS")]
-    public string Remarks { get; set; }
+    [SugarColumn(ColumnName = "NOTE")]
+    public string? Note { get; set; }
 
     /// <summary>
-    ///     閿�鍞鍗曞崟鍙�
+    ///     閫�璐х被鍨�
     /// </summary>
-    [SugarColumn(ColumnName = "SALES_ORDER_ID")]
-    public string SalesOrderId { get; set; }
+    [SugarColumn(ColumnName = "RETURN_TYPE")]
+    public string? ReturnType { get; set; }
 
     /// <summary>
-    ///     閿�鍞鍗曞垎褰�
+    ///     璺熷崟鍛�
     /// </summary>
-    [SugarColumn(ColumnName = "SALES_ORDER_ENTRY")]
-    public string SalesOrderEntry { get; set; }
+    [SugarColumn(ColumnName = "SALES_CLERK")]
+    public string? SalesClerk { get; set; }
 
     /// <summary>
-    ///     閿�鍞鍗旾D
+    ///     搴撳瓨鍗曚綅
     /// </summary>
-    [SugarColumn(ColumnName = "SALES_ORDER_DETAIL_ID")]
-    public string SalesOrderDetailId { get; set; }
+    [SugarColumn(ColumnName = "INVENTORY_UNIT")]
+    public string? InventoryUnit { get; set; }
 
     /// <summary>
-    ///     鍩烘湰鍗曚环
+    ///     搴撳瓨鏁伴噺
     /// </summary>
-    [SugarColumn(ColumnName = "BASE_UNIT_PRICE")]
-    public decimal? BaseUnitPrice { get; set; }
+    [SugarColumn(ColumnName = "INVENTORY_QUANTITY")]
+    public decimal? InventoryQuantity { get; set; }
 
     /// <summary>
-    ///     鍩烘湰鍗曚綅鏁伴噺
+    ///     鐗╂枡绫诲埆
     /// </summary>
-    [SugarColumn(ColumnName = "BASE_UNIT_QUANTITY")]
-    public decimal? BaseUnitQuantity { get; set; }
+    [SugarColumn(ColumnName = "MATERIAL_CATEGORY")]
+    public string? MaterialCategory { get; set; }
 
     /// <summary>
-    ///     浠撳簱浠g爜
+    ///     璐т富绫诲瀷
     /// </summary>
-    [SugarColumn(ColumnName = "WAREHOUSE_CODE")]
-    public string WarehouseCode { get; set; }
+    [SugarColumn(ColumnName = "OWNER_TYPE_ID")]
+    public string? OwnerTypeId { get; set; }
 
     /// <summary>
-    ///     浠撳簱鍚嶇О
+    ///     璐т富
     /// </summary>
-    [SugarColumn(ColumnName = "WAREHOUSE_NAME")]
-    public string WarehouseName { get; set; }
+    [SugarColumn(ColumnName = "OWNER_ID")]
+    public string? OwnerId { get; set; }
 
     /// <summary>
-    ///     鍩烘湰鍗曚綅鍑哄簱鏁伴噺
+    ///     婧愬崟绫诲瀷
     /// </summary>
-    [SugarColumn(ColumnName = "BASE_UNIT_OUT_QUANTITY")]
-    public decimal? BaseUnitOutQuantity { get; set; }
+    [SugarColumn(ColumnName = "SOURCE_BILL_TYPE")]
+    public string? SourceBillType { get; set; }
 
     /// <summary>
-    ///     鍗曚綅
+    ///     婧愬崟鍗曞彿
     /// </summary>
-    [SugarColumn(ColumnName = "UNIT")]
-    public string Unit { get; set; }
+    [SugarColumn(ColumnName = "SOURCE_BILL_NO")]
+    public string? SourceBillNo { get; set; }
+
+    /// <summary>
+    ///     璁㈠崟鍗曞彿
+    /// </summary>
+    [SugarColumn(ColumnName = "ORDER_BILL_NO")]
+    public string? OrderBillNo { get; set; }
 
     /// <summary>
     ///     ERPID
     /// </summary>
-    [SugarColumn(ColumnName = "ERP_ID")]
-    public string ErpId { get; set; }
+    [SugarColumn(ColumnName = "ERP_LINE_ID")]
+    public string ErpLineId { get; set; }
 
     /// <summary>
     ///     ERP澶碔D
diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.dll b/MES.Service/bin/Debug/net8.0/MES.Service.dll
index d622a0f..0a2ca83 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.dll
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.pdb b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
index 6c21664..546e71f 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.pdb
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MES.Service/service/BasicData/SalesDeliveryNoticeDetailManager.cs b/MES.Service/service/BasicData/SalesDeliveryNoticeDetailManager.cs
new file mode 100644
index 0000000..904f66d
--- /dev/null
+++ b/MES.Service/service/BasicData/SalesDeliveryNoticeDetailManager.cs
@@ -0,0 +1,80 @@
+锘縰sing MES.Service.DB;
+using MES.Service.Modes;
+using SqlSugar;
+
+namespace MES.Service.service.BasicData;
+
+public class SalesDeliveryNoticeDetailManager : Repository<SalesDeliveryNoticeDetail>
+{
+    //褰撳墠绫诲凡缁忕户鎵夸簡 Repository 澧炪�佸垹銆佹煡銆佹敼鐨勬柟娉�
+
+    //杩欓噷闈㈠啓鐨勪唬鐮佷笉浼氱粰瑕嗙洊,濡傛灉瑕侀噸鏂扮敓鎴愯鍒犻櫎 SalesReturnNoticeDetailManager.cs
+
+
+    #region 鏁欏鏂规硶
+
+    /// <summary>
+    ///     浠撳偍鏂规硶婊¤冻涓嶄簡澶嶆潅涓氬姟闇�姹傦紝涓氬姟浠g爜璇峰湪杩欓噷闈㈠畾涔夋柟娉�
+    /// </summary>
+    public void Study()
+    {
+        /*********鏌ヨ*********/
+
+        var data1 = base.GetById(1); //鏍规嵁ID鏌ヨ
+        var data2 = base.GetList(); //鏌ヨ鎵�鏈�
+        var data3 = base.GetList(it => 1 == 1); //鏍规嵁鏉′欢鏌ヨ  
+        //var data4 = base.GetSingle(it => 1 == 1);//鏍规嵁鏉′欢鏌ヨ涓�鏉�,濡傛灉瓒呰繃涓�鏉′細鎶ラ敊
+
+        var p = new PageModel { PageIndex = 1, PageSize = 2 }; // 鍒嗛〉鏌ヨ
+        var data5 = base.GetPageList(it => 1 == 1, p);
+        Console.Write(p.TotalCount); //杩斿洖鎬绘暟
+
+        var data6 =
+            base.GetPageList(it => 1 == 1, p,
+                it => SqlFunc.GetRandom()); // 鍒嗛〉鏌ヨ鍔犳帓搴�
+        Console.Write(p.TotalCount); //杩斿洖鎬绘暟
+
+        var conModels = new List<IConditionalModel>(); //缁勮鏉′欢鏌ヨ浣滀负鏉′欢瀹炵幇 鍒嗛〉鏌ヨ鍔犳帓搴�
+        conModels.Add(new ConditionalModel
+        {
+            FieldName = typeof(SalesReturnNoticeDetail).GetProperties()[0].Name,
+            ConditionalType = ConditionalType.Equal,
+            FieldValue = "1"
+        }); //id=1
+        var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom());
+
+        AsQueryable().Where(x => 1 == 1)
+            .ToList(); //鏀寔浜嗚浆鎹㈡垚queryable,鎴戜滑鍙互鐢╭ueryable瀹炵幇澶嶆潅鍔熻兘
+
+
+        /*********鎻掑叆*********/
+        var insertData = new SalesDeliveryNoticeDetail(); //娴嬭瘯鍙傛暟
+        var insertArray = new[] { insertData };
+        base.Insert(insertData); //鎻掑叆
+        base.InsertRange(insertArray); //鎵归噺鎻掑叆
+        var id = base.InsertReturnIdentity(insertData); //鎻掑叆杩斿洖鑷鍒�
+        AsInsertable(insertData).ExecuteCommand(); //鎴戜滑鍙互杞垚 Insertable瀹炵幇澶嶆潅鎻掑叆
+
+
+        /*********鏇存柊*********/
+        var updateData = new SalesDeliveryNoticeDetail(); //娴嬭瘯鍙傛暟
+        var updateArray = new[] { updateData }; //娴嬭瘯鍙傛暟
+        base.Update(updateData); //鏍规嵁瀹炰綋鏇存柊
+        base.UpdateRange(updateArray); //鎵归噺鏇存柊
+        //base.Update(it => new SalesReturnNoticeDetail() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// 鍙洿鏂癈lassName鍒楀拰CreateTime鍒楋紝鍏跺畠鍒椾笉鏇存柊锛屾潯浠秈d=1
+        AsUpdateable(updateData).ExecuteCommand(); //杞垚Updateable鍙互瀹炵幇澶嶆潅鐨勬彃鍏�
+
+
+        /*********鍒犻櫎*********/
+        var deldata = new SalesDeliveryNoticeDetail(); //娴嬭瘯鍙傛暟
+        base.Delete(deldata); //鏍规嵁瀹炰綋鍒犻櫎
+        base.DeleteById(1); //鏍规嵁涓婚敭鍒犻櫎
+        base.DeleteById(new[] { 1, 2 }); //鏍规嵁涓婚敭鏁扮粍鍒犻櫎
+        base.Delete(it => 1 == 2); //鏍规嵁鏉′欢鍒犻櫎
+        AsDeleteable().Where(it => 1 == 2)
+            .ExecuteCommand(); //杞垚Deleteable瀹炵幇澶嶆潅鐨勬搷浣�
+    }
+
+    #endregion
+
+}
diff --git a/MES.Service/service/BasicData/SalesDeliveryNoticeManager.cs b/MES.Service/service/BasicData/SalesDeliveryNoticeManager.cs
new file mode 100644
index 0000000..d936c38
--- /dev/null
+++ b/MES.Service/service/BasicData/SalesDeliveryNoticeManager.cs
@@ -0,0 +1,262 @@
+锘縰sing MES.Service.DB;
+using MES.Service.Dto.webApi;
+using MES.Service.Modes;
+using SqlSugar;
+
+namespace MES.Service.service.BasicData;
+
+public class SalesDeliveryNoticeManager : Repository<SalesDeliveryNotice>
+{
+    //褰撳墠绫诲凡缁忕户鎵夸簡 Repository 澧炪�佸垹銆佹煡銆佹敼鐨勬柟娉�
+
+    //杩欓噷闈㈠啓鐨勪唬鐮佷笉浼氱粰瑕嗙洊,濡傛灉瑕侀噸鏂扮敓鎴愯鍒犻櫎 SalesReturnNoticeManager.cs
+
+
+    #region 鏁欏鏂规硶
+
+    /// <summary>
+    ///     浠撳偍鏂规硶婊¤冻涓嶄簡澶嶆潅涓氬姟闇�姹傦紝涓氬姟浠g爜璇峰湪杩欓噷闈㈠畾涔夋柟娉�
+    /// </summary>
+    public void Study()
+    {
+        /*********鏌ヨ*********/
+
+        var data1 = base.GetById(1); //鏍规嵁ID鏌ヨ
+        var data2 = base.GetList(); //鏌ヨ鎵�鏈�
+        var data3 = base.GetList(it => 1 == 1); //鏍规嵁鏉′欢鏌ヨ  
+        //var data4 = base.GetSingle(it => 1 == 1);//鏍规嵁鏉′欢鏌ヨ涓�鏉�,濡傛灉瓒呰繃涓�鏉′細鎶ラ敊
+
+        var p = new PageModel { PageIndex = 1, PageSize = 2 }; // 鍒嗛〉鏌ヨ
+        var data5 = base.GetPageList(it => 1 == 1, p);
+        Console.Write(p.TotalCount); //杩斿洖鎬绘暟
+
+        var data6 =
+            base.GetPageList(it => 1 == 1, p,
+                it => SqlFunc.GetRandom()); // 鍒嗛〉鏌ヨ鍔犳帓搴�
+        Console.Write(p.TotalCount); //杩斿洖鎬绘暟
+
+        var conModels = new List<IConditionalModel>(); //缁勮鏉′欢鏌ヨ浣滀负鏉′欢瀹炵幇 鍒嗛〉鏌ヨ鍔犳帓搴�
+        conModels.Add(new ConditionalModel
+        {
+            FieldName = typeof(SalesReturnNotice).GetProperties()[0].Name,
+            ConditionalType = ConditionalType.Equal,
+            FieldValue = "1"
+        }); //id=1
+        var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom());
+
+        AsQueryable().Where(x => 1 == 1)
+            .ToList(); //鏀寔浜嗚浆鎹㈡垚queryable,鎴戜滑鍙互鐢╭ueryable瀹炵幇澶嶆潅鍔熻兘
+
+
+        /*********鎻掑叆*********/
+        var insertData = new SalesDeliveryNotice(); //娴嬭瘯鍙傛暟
+        var insertArray = new[] { insertData };
+        base.Insert(insertData); //鎻掑叆
+        base.InsertRange(insertArray); //鎵归噺鎻掑叆
+        var id = base.InsertReturnIdentity(insertData); //鎻掑叆杩斿洖鑷鍒�
+        AsInsertable(insertData).ExecuteCommand(); //鎴戜滑鍙互杞垚 Insertable瀹炵幇澶嶆潅鎻掑叆
+
+
+        /*********鏇存柊*********/
+        var updateData = new SalesDeliveryNotice(); //娴嬭瘯鍙傛暟
+        var updateArray = new[] { updateData }; //娴嬭瘯鍙傛暟
+        base.Update(updateData); //鏍规嵁瀹炰綋鏇存柊
+        base.UpdateRange(updateArray); //鎵归噺鏇存柊
+        //base.Update(it => new SalesReturnNotice() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// 鍙洿鏂癈lassName鍒楀拰CreateTime鍒楋紝鍏跺畠鍒椾笉鏇存柊锛屾潯浠秈d=1
+        AsUpdateable(updateData).ExecuteCommand(); //杞垚Updateable鍙互瀹炵幇澶嶆潅鐨勬彃鍏�
+
+
+        /*********鍒犻櫎*********/
+        var deldata = new SalesDeliveryNotice(); //娴嬭瘯鍙傛暟
+        base.Delete(deldata); //鏍规嵁瀹炰綋鍒犻櫎
+        base.DeleteById(1); //鏍规嵁涓婚敭鍒犻櫎
+        base.DeleteById(new[] { 1, 2 }); //鏍规嵁涓婚敭鏁扮粍鍒犻櫎
+        base.Delete(it => 1 == 2); //鏍规嵁鏉′欢鍒犻櫎
+        AsDeleteable().Where(it => 1 == 2)
+            .ExecuteCommand(); //杞垚Deleteable瀹炵幇澶嶆潅鐨勬搷浣�
+    }
+
+    #endregion
+
+    private readonly SalesDeliveryNoticeDetailManager salesDeliveryNoticeDetailManager = new();
+
+    // Save 鏂规硶鐢ㄤ簬淇濆瓨鍗曚釜 閿�鍞鍗�(SalesOrder) 璁板綍锛屾牴鎹被鍨嬫墽琛屼笉鍚岀殑鎿嶄綔
+    public bool Save(SaleDeliveryNotice saleDeliveryNotice)
+    {
+        var salesDeliveryNoticeErpSalesDeliveryNotice = saleDeliveryNotice.ErpSalesDeliveryNotice;
+        var mesSalesDeliveryNotice = GetSalesDeliveryNotice(salesDeliveryNoticeErpSalesDeliveryNotice);
+        var mesSalesDeliveryNoticeDetails = GetErpSalesDeliveryNoticeDetail(saleDeliveryNotice.ErpSalesDeliveryNoticeDetails, salesDeliveryNoticeErpSalesDeliveryNotice.type);
+
+        return UseTransaction(db =>
+        {
+            switch (salesDeliveryNoticeErpSalesDeliveryNotice.type)
+            {
+                case "3":
+                    return UpdateData(db, mesSalesDeliveryNotice, mesSalesDeliveryNoticeDetails) ? 1 : 0;
+                case "2":
+                case "4":
+                case "5":
+                case "6":
+                    return SaveOrUpdateData(db, mesSalesDeliveryNotice, mesSalesDeliveryNoticeDetails)
+                        ? 1
+                        : 0;
+                default:
+                    throw new NotImplementedException(
+                        $"type娌℃湁{salesDeliveryNoticeErpSalesDeliveryNotice.type}杩欎釜绫诲瀷");
+            }
+        }) > 0;
+
+    }
+
+
+
+    // 鏇存柊鏁版嵁鐨勬柟娉�(鍗曠函鐨勫垹闄�)
+    private bool UpdateData(SqlSugarScope db, SalesDeliveryNotice salesDeliveryNotice,
+        List<SalesDeliveryNoticeDetail> salesDeliveryNoticeDetails)
+    {
+        var decimals = salesDeliveryNoticeDetails.Select(s => s.Id).ToArray();
+        var update = base.DeleteById(salesDeliveryNotice.Id);
+        var insertOrUpdate = db
+            .Deleteable<SalesOrderDetail>().In(decimals)
+            .ExecuteCommand() > 0;
+
+        if (update && insertOrUpdate) return true;
+        throw new NotImplementedException("鍒犻櫎澶辫触");
+    }
+
+    // 鎻掑叆鎴栨洿鏂版暟鎹殑鏂规硶
+    private bool SaveOrUpdateData(SqlSugarScope db, SalesDeliveryNotice salesDeliveryNotice,
+        List<SalesDeliveryNoticeDetail> salesDeliveryNoticeDetails)
+    {
+        if (salesDeliveryNotice.Id != null) base.DeleteById(salesDeliveryNotice.Id);
+
+        if (salesDeliveryNoticeDetails.Count > 0)
+            db.Deleteable<SalesOrderDetail>()
+                .Where(s => s.ErpId == salesDeliveryNotice.Id).ExecuteCommand();
+
+        var orUpdate = base.Insert(salesDeliveryNotice);
+        var baOrUpdate = salesDeliveryNoticeDetailManager.InsertRange(salesDeliveryNoticeDetails);
+        if (orUpdate && baOrUpdate) return true;
+        throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�");
+    }
+
+    // 鎵归噺淇濆瓨璁板綍鐨勬柟娉�
+    public bool SaveList(List<SaleDeliveryNotice> saleDeliveryNotices)
+    {
+        var result = saleDeliveryNotices.Select(Save).ToList();
+        return result.All(b => b);
+    }
+
+
+    // 灏� erpSalesDeliveryNotice 瀵硅薄杞崲涓� SalesReturnNotice 瀵硅薄鐨勬柟娉�
+    public SalesDeliveryNotice GetSalesDeliveryNotice(ErpSalesDeliveryNotice erpSalesDeliveryNotice)
+    {
+
+        var eid = Convert.ToDecimal(erpSalesDeliveryNotice.Id);
+        var MesSalesDeliveryNotice = new SalesDeliveryNotice();
+
+        var single = base.GetSingle(it => it.Id == eid);
+        if (single != null) MesSalesDeliveryNotice.Id = single.Id;
+
+        MesSalesDeliveryNotice.ErpId = erpSalesDeliveryNotice.erpID;
+        MesSalesDeliveryNotice.BillType = erpSalesDeliveryNotice.fBillTypeID;
+        MesSalesDeliveryNotice.BillNo = erpSalesDeliveryNotice.fBillNo;
+
+        if (erpSalesDeliveryNotice.fDate != null)
+            MesSalesDeliveryNotice.FDate = DateTime.ParseExact(erpSalesDeliveryNotice.fDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesDeliveryNotice.Currency = erpSalesDeliveryNotice.fSettleCurrld;
+        MesSalesDeliveryNotice.SalesDept = erpSalesDeliveryNotice.fSaleDeptId;
+        MesSalesDeliveryNotice.Customer = erpSalesDeliveryNotice.fCustomerID;
+        MesSalesDeliveryNotice.DeliveryMethod = erpSalesDeliveryNotice.fHeadDeliveryWay;
+        MesSalesDeliveryNotice.DeliveryLocation = erpSalesDeliveryNotice.fHeadLocId;
+        MesSalesDeliveryNotice.Carrier = erpSalesDeliveryNotice.fCarrierID;
+        MesSalesDeliveryNotice.SettleParty = erpSalesDeliveryNotice.fCarriageNO;
+        MesSalesDeliveryNotice.SettleParty = erpSalesDeliveryNotice.fDeliveryDeptID;
+        MesSalesDeliveryNotice.InventoryGroup = erpSalesDeliveryNotice.fStockerGroupId;
+        MesSalesDeliveryNotice.WarehouseManager = erpSalesDeliveryNotice.fStockerId;
+        MesSalesDeliveryNotice.SalesGroup = erpSalesDeliveryNotice.fSaleGroupId;
+        MesSalesDeliveryNotice.SalesPerson = erpSalesDeliveryNotice.fSalesManId;
+        MesSalesDeliveryNotice.Receiver = erpSalesDeliveryNotice.fReceiveCusId;
+        MesSalesDeliveryNotice.ReceiverContact = erpSalesDeliveryNotice.fReceiveCusContact;
+        MesSalesDeliveryNotice.ReceiverAddress = erpSalesDeliveryNotice.fReceiveAddress;
+        MesSalesDeliveryNotice.ReceiverName = erpSalesDeliveryNotice.fLinkMan;
+        MesSalesDeliveryNotice.ReceiverName = erpSalesDeliveryNotice.fLinkPhone;
+        MesSalesDeliveryNotice.SettleParty = erpSalesDeliveryNotice.fSettleID;
+        MesSalesDeliveryNotice.PayerParty = erpSalesDeliveryNotice.fPayerID;
+        MesSalesDeliveryNotice.CreatedBy = erpSalesDeliveryNotice.fCreatorId;
+
+        if (erpSalesDeliveryNotice.fCreateDate != null)
+            MesSalesDeliveryNotice.CreatedDate = DateTime.ParseExact(erpSalesDeliveryNotice.fCreateDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesDeliveryNotice.ModifiedBy = erpSalesDeliveryNotice.fModifierId;
+
+        if (erpSalesDeliveryNotice.fModifyDate != null)
+            MesSalesDeliveryNotice.ModifiedDate = DateTime.ParseExact(erpSalesDeliveryNotice.fModifyDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesDeliveryNotice.ApprovedBy = erpSalesDeliveryNotice.fApproverId;
+
+        if (erpSalesDeliveryNotice.fApproveDate != null)
+            MesSalesDeliveryNotice.ApprovedDate = DateTime.ParseExact(erpSalesDeliveryNotice.fApproveDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesDeliveryNotice.ClosedBy = erpSalesDeliveryNotice.fCloserId;
+        MesSalesDeliveryNotice.CloseReason = erpSalesDeliveryNotice.fCloseReason;
+        MesSalesDeliveryNotice.CloseStatus = erpSalesDeliveryNotice.fBillCloseStatus;
+        MesSalesDeliveryNotice.CancelStatus = erpSalesDeliveryNotice.fCancelStatus;
+        MesSalesDeliveryNotice.CancelledBy = erpSalesDeliveryNotice.fCancellerId;
+
+        if (erpSalesDeliveryNotice.fCancelDate != null)
+            MesSalesDeliveryNotice.CancelDate = DateTime.ParseExact(erpSalesDeliveryNotice.fCancelDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesDeliveryNotice.BillStatus = erpSalesDeliveryNotice.fDocumentStatus;
+
+        return MesSalesDeliveryNotice;
+    }
+
+    // 灏� erpSalesDeliveryNoticeDetail 瀵硅薄杞崲涓� SalesReturnNoticeDetail 瀵硅薄鐨勬柟娉�
+    public List<SalesDeliveryNoticeDetail> GetErpSalesDeliveryNoticeDetail(
+        List<ErpSalesDeliveryNoticeDetail> erpSalesDeliveryNoticeDetails, string type)
+    {
+        return erpSalesDeliveryNoticeDetails.Select(s =>
+        {
+            var entity = new SalesDeliveryNoticeDetail
+            {
+                Id = Convert.ToDecimal(s.Id),
+                ErpLineId = s.erpID,
+                ErpHeadId = s.ehid,
+                MaterialId = s.fMaterialId,
+                MaterialName = s.fUnitID,
+                SalesQuantity = Convert.ToDecimal(s.fQty),
+                IsFree = s.fIsFree,
+                DeliveryDate = s.fDeliverydate != null ? DateTime.ParseExact(s.fDeliverydate, "yyyy-MM-dd HH:mm:ss", null) : null,
+                WareHouse = s.fStockId,
+                PlanTrackingNumber = s.fMtoNo,
+                LotNumber = s.fLot,
+                PriceQty = Convert.ToDecimal(s.fPriceUnitQty),
+                OwnerId = s.fOwnerIdHead,
+                InventoryUnit = s.fStockUnitID,
+                InventoryQuantity = Convert.ToDecimal(s.fStockQty),
+                PlanDeliveryDate = s.fPlanDeliveryDate != null ? DateTime.ParseExact(s.fPlanDeliveryDate, "yyyy-MM-dd HH:mm:ss", null) : null,
+                OutLmtUnit = s.fOutLmtUnit,
+                OutMaxQty = Convert.ToDecimal(s.fOutMaxQty),
+                OutMinQty = Convert.ToDecimal(s.fOutMinQty),
+                DeliveryLoc = s.fDeliveryLoc,
+                DeliveryAddress = s.fDeliveryLAddress,
+                SourceBillNo = s.fSrcBillNo,
+                OrderBillNo = s.fOrderNo,
+                TerminationStatus = s.fTerminationStatus,
+                TerminationDate = s.fTerminateDate != null ? DateTime.ParseExact(s.fTerminateDate, "yyyy-MM-dd HH:mm:ss", null) : null,
+                SumOutQty = Convert.ToDecimal(s.fSumOutQty),
+                RemainOutQty = Convert.ToDecimal(s.fRemainOutQty),
+                FentryNote = s.FNoteEntry,
+
+            };
+
+            var single = salesDeliveryNoticeDetailManager.GetSingle(it =>
+                it.Id == entity.Id);
+            if (single != null) entity.Id = single.Id;
+
+            return entity;
+        }).ToList();
+    }
+}
diff --git a/MES.Service/service/BasicData/SalesOrderManager.cs b/MES.Service/service/BasicData/SalesOrderManager.cs
index b466f00..d635c50 100644
--- a/MES.Service/service/BasicData/SalesOrderManager.cs
+++ b/MES.Service/service/BasicData/SalesOrderManager.cs
@@ -1,4 +1,5 @@
 锘縰sing MES.Service.DB;
+using MES.Service.Dto.webApi;
 using MES.Service.Modes;
 using SqlSugar;
 
@@ -38,7 +39,8 @@
         conModels.Add(new ConditionalModel
         {
             FieldName = typeof(SalesOrder).GetProperties()[0].Name,
-            ConditionalType = ConditionalType.Equal, FieldValue = "1"
+            ConditionalType = ConditionalType.Equal,
+            FieldValue = "1"
         }); //id=1
         var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom());
 
@@ -75,4 +77,188 @@
     }
 
     #endregion
+
+
+    private readonly SalesOrderDetailManager salesOrderDetailManager = new();
+
+    // Save 鏂规硶鐢ㄤ簬淇濆瓨鍗曚釜 閿�鍞鍗�(SalesOrder) 璁板綍锛屾牴鎹被鍨嬫墽琛屼笉鍚岀殑鎿嶄綔
+    public bool Save(SalesOrders salesOrders)
+    {
+        var salesOrdersErpSalesOrder = salesOrders.ErpSalesOrder;
+        var mesSalesOrders = GetMesSalesOrder(salesOrdersErpSalesOrder);
+        var mesSalesOrderDetail = GetErpSalesOrderDetail(salesOrders.ErpSalesOrderDetails,salesOrdersErpSalesOrder.Type);
+
+        return UseTransaction(db =>
+        {
+            switch (salesOrdersErpSalesOrder.Type)
+            {
+                case "3":
+                    return UpdateData(db, mesSalesOrders, mesSalesOrderDetail) ? 1 : 0;
+                case "2":
+                case "4":
+                case "5":
+                case "B":
+                    return SaveOrUpdateData(db, mesSalesOrders, mesSalesOrderDetail)
+                        ? 1
+                        : 0;
+                default:
+                    throw new NotImplementedException(
+                        $"type娌℃湁{salesOrdersErpSalesOrder.Type}杩欎釜绫诲瀷");
+            }
+        }) > 0;
+
+    }
+
+
+
+    // 鏇存柊鏁版嵁鐨勬柟娉�(鍗曠函鐨勫垹闄�)
+    private bool UpdateData(SqlSugarScope db, SalesOrder salesOrder,
+        List<SalesOrderDetail> salesOrderDetails)
+    {
+        var decimals = salesOrderDetails.Select(s => s.Id).ToArray();
+        var update = base.DeleteById(salesOrder.Id);
+        var insertOrUpdate = db
+            .Deleteable<SalesOrderDetail>().In(decimals)
+            .ExecuteCommand() > 0;
+
+        if (update && insertOrUpdate) return true;
+        throw new NotImplementedException("鍒犻櫎澶辫触");
+    }
+
+    // 鎻掑叆鎴栨洿鏂版暟鎹殑鏂规硶
+    private bool SaveOrUpdateData(SqlSugarScope db, SalesOrder salesOrder,
+        List<SalesOrderDetail> salesOrderDetails)
+    {
+        if (salesOrder.Id != null) base.DeleteById(salesOrder.Id);
+
+        if (salesOrderDetails.Count > 0)
+            db.Deleteable<SalesOrderDetail>()
+                .Where(s => s.ErpId == salesOrder.Id).ExecuteCommand();
+
+        var orUpdate = base.Insert(salesOrder);
+        var baOrUpdate = salesOrderDetailManager.InsertRange(salesOrderDetails);
+        if (orUpdate && baOrUpdate) return true;
+        throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�");
+    }
+
+    // 鎵归噺淇濆瓨璁板綍鐨勬柟娉�
+    public bool SaveList(List<SalesOrders> salesOrders)
+    {
+        var result = salesOrders.Select(Save).ToList();
+        return result.All(b => b);
+    }
+
+
+    // 灏� ErpSalesOrder 瀵硅薄杞崲涓� SalesOrder 瀵硅薄鐨勬柟娉�
+    public SalesOrder GetMesSalesOrder(ErpSalesOrder erpSalesOrder)
+    {
+
+        var eid = Convert.ToDecimal(erpSalesOrder.Id);
+        var MesSalesOrder = new SalesOrder();
+
+        var single = base.GetSingle(it => it.Id == eid);
+        if (single != null) MesSalesOrder.Id = single.Id;
+
+        MesSalesOrder.ErpId = Convert.ToDecimal(erpSalesOrder.ErpID);
+        MesSalesOrder.BillNo = erpSalesOrder.FBillNo;
+        MesSalesOrder.BillTypeId = erpSalesOrder.FBillTypeID;
+        MesSalesOrder.DocumentStatus = erpSalesOrder.FDocumentStatus;
+
+        if (erpSalesOrder.FDate != null)
+            MesSalesOrder.FDate = DateTime.ParseExact(erpSalesOrder.FDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesOrder.BusinessType = erpSalesOrder.FBusinessType;
+        MesSalesOrder.HeadDeliveryWay = erpSalesOrder.FHeadDeliveryWay;
+        MesSalesOrder.CloseStatus = erpSalesOrder.FCloseStatus;
+        MesSalesOrder.HeadLocId = erpSalesOrder.FHEADLOCID;
+        MesSalesOrder.CustId = erpSalesOrder.FCustId;
+        MesSalesOrder.CloseStatus = erpSalesOrder.FCloseStatus;
+        MesSalesOrder.SaleDeptId = erpSalesOrder.FSaleDeptId;
+        MesSalesOrder.SalerId = erpSalesOrder.FSalerId;
+        MesSalesOrder.ChangeReason = erpSalesOrder.FChangeReason;
+        MesSalesOrder.Note = erpSalesOrder.FNote;
+        MesSalesOrder.SettleId = erpSalesOrder.FSettleId;
+        MesSalesOrder.LinkMan = erpSalesOrder.FLinkMan;
+        MesSalesOrder.ChargeId = erpSalesOrder.FChargeId;
+        MesSalesOrder.LinkPhone = erpSalesOrder.FLinkPhone;
+        MesSalesOrder.CreatorId = erpSalesOrder.FCreatorId;
+
+        if (erpSalesOrder.FCreateDate != null)
+            MesSalesOrder.CreateDate = DateTime.ParseExact(erpSalesOrder.FCreateDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesOrder.ModifierId = erpSalesOrder.FModifierId;
+
+        if (erpSalesOrder.FModifyDate != null)
+            MesSalesOrder.ModifyDate = DateTime.ParseExact(erpSalesOrder.FModifyDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        if (erpSalesOrder.FApproveDate != null)
+            MesSalesOrder.ApproveDate = DateTime.ParseExact(erpSalesOrder.FApproveDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesOrder.CloserId = erpSalesOrder.FCloserId;
+
+        if (erpSalesOrder.FCloseDate != null)
+            MesSalesOrder.CloseDate = DateTime.ParseExact(erpSalesOrder.FCloseDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        if (erpSalesOrder.FChangeDate != null)
+            MesSalesOrder.ChangeDate = DateTime.ParseExact(erpSalesOrder.FChangeDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesOrder.CancelStatus = erpSalesOrder.FCancelStatus;
+        MesSalesOrder.CancellerId = erpSalesOrder.FCancellerId;
+        MesSalesOrder.VersionNo = Convert.ToDecimal(erpSalesOrder.FVersionNo);
+        MesSalesOrder.ChangerId = erpSalesOrder.FChangerId;
+        MesSalesOrder.EntryNote = erpSalesOrder.FEntryNote;
+
+        return MesSalesOrder;
+    }
+
+    // 灏� ErpSalesOrderDetail 瀵硅薄杞崲涓� SalesOrderDetail 瀵硅薄鐨勬柟娉�
+    public List<SalesOrderDetail> GetErpSalesOrderDetail(
+        List<ErpSalesOrderDetail> erpSalesOrderDetails, string type)
+    {
+        return erpSalesOrderDetails.Select(s =>
+        {
+            var entity = new SalesOrderDetail
+            {
+                Id = Convert.ToDecimal(s.Id),
+                ErpId = Convert.ToDecimal(s.ErpID),
+                EHid = Convert.ToDecimal(s.EHID),
+                MaterialIDd = s.FMaterialId,
+                UnitId = s.FUnitID,
+                Qty = Convert.ToDecimal(s.FQty),
+                PriceUnitId = s.FPriceUnitId,
+                PriceUnitQty = Convert.ToDecimal(s.FPriceUnitQty),
+                DeliveryDate = s.FDeliveryDate != null ? DateTime.ParseExact(s.FDeliveryDate, "yyyy-MM-dd HH:mm:ss", null) : null,
+                IsFree = s.FIsFree,
+                OwnerTypeId = s.FOwnerTypeId,
+                OwnerId = s.FOwnerId,
+                EntryNote = s.FEntryNote,
+                MtoNo = s.FMtoNo,
+                Lot = s.FLot,
+                DeliveryMaxQty = Convert.ToDecimal(s.FDeliveryMaxQty),
+                DeliveryMinQty = Convert.ToDecimal(s.FDeliveryMinQty),
+                OutLmtUnitId = s.FOutLmtUnitID,
+                MrpCloseStatus = s.FMrpCloseStatus,
+                MrpTerminateStatus = s.FMrpTerminateStatus,
+                TerminateDate = s.FTerminateDate != null ? DateTime.ParseExact(s.FTerminateDate, "yyyy-MM-dd HH:mm:ss", null) : null,
+                TerminaterId = s.FTerminaterId,
+                SrcType = s.FSrcType,
+                SrcBillNo = s.FSrcBillNo,
+                DeliQty = Convert.ToDecimal(s.FDeliQty),
+                StockOutQty = Convert.ToDecimal(s.FStockOutQty),
+                BaseRetNoticeQty = Convert.ToDecimal(s.FBaseRetNoticeQty),
+                BaseReturnQty = Convert.ToDecimal(s.FBaseReturnQty),
+                BaseRemainOutQty = Convert.ToDecimal(s.FBaseRemainOutQty),
+                BaseArQty = Convert.ToDecimal(s.FBASEARQTY),
+
+
+
+            };
+
+            var single = salesOrderDetailManager.GetSingle(it =>
+                it.Id == entity.Id);
+            if (single != null) entity.Id = single.Id;
+
+            return entity;
+        }).ToList();
+    }
 }
\ No newline at end of file
diff --git a/MES.Service/service/BasicData/SalesReturnNoticeManager.cs b/MES.Service/service/BasicData/SalesReturnNoticeManager.cs
index 206f0ea..c8395f6 100644
--- a/MES.Service/service/BasicData/SalesReturnNoticeManager.cs
+++ b/MES.Service/service/BasicData/SalesReturnNoticeManager.cs
@@ -1,4 +1,5 @@
 锘縰sing MES.Service.DB;
+using MES.Service.Dto.webApi;
 using MES.Service.Modes;
 using SqlSugar;
 
@@ -75,4 +76,182 @@
     }
 
     #endregion
+
+    private readonly SalesReturnNoticeDetailManager salesReturnNoticeDetailManager = new();
+
+    // Save 鏂规硶鐢ㄤ簬淇濆瓨鍗曚釜 閿�鍞鍗�(SalesOrder) 璁板綍锛屾牴鎹被鍨嬫墽琛屼笉鍚岀殑鎿嶄綔
+    public bool Save(SaleReturnNotice saleReturnNotice)
+    {
+        var salesReturnNoticeErpSalesReturnNotice = saleReturnNotice.erpSalesReturnNotice;
+        var mesSalesReturnNotice = GetSalesReturnNotice(salesReturnNoticeErpSalesReturnNotice);
+        var mesSalesReturnNoticeDetails = GetErpSalesOrderDetail(saleReturnNotice.erpSalesReturnNoticeDetail, salesReturnNoticeErpSalesReturnNotice.type);
+
+        return UseTransaction(db =>
+        {
+            switch (salesReturnNoticeErpSalesReturnNotice.type)
+            {
+                case "3":
+                    return UpdateData(db, mesSalesReturnNotice, mesSalesReturnNoticeDetails) ? 1 : 0;
+                case "2":
+                case "4":
+                case "5":
+                case "6":
+                    return SaveOrUpdateData(db, mesSalesReturnNotice, mesSalesReturnNoticeDetails)
+                        ? 1
+                        : 0;
+                default:
+                    throw new NotImplementedException(
+                        $"type娌℃湁{salesReturnNoticeErpSalesReturnNotice.type}杩欎釜绫诲瀷");
+            }
+        }) > 0;
+
+    }
+
+
+
+    // 鏇存柊鏁版嵁鐨勬柟娉�(鍗曠函鐨勫垹闄�)
+    private bool UpdateData(SqlSugarScope db, SalesReturnNotice salesReturnNotice,
+        List<SalesReturnNoticeDetail> salesReturnNoticeDetails)
+    {
+        var decimals = salesReturnNoticeDetails.Select(s => s.Id).ToArray();
+        var update = base.DeleteById(salesReturnNotice.Id);
+        var insertOrUpdate = db
+            .Deleteable<SalesOrderDetail>().In(decimals)
+            .ExecuteCommand() > 0;
+
+        if (update && insertOrUpdate) return true;
+        throw new NotImplementedException("鍒犻櫎澶辫触");
+    }
+
+    // 鎻掑叆鎴栨洿鏂版暟鎹殑鏂规硶
+    private bool SaveOrUpdateData(SqlSugarScope db, SalesReturnNotice salesReturnNotice,
+        List<SalesReturnNoticeDetail> salesReturnNoticeDetails)
+    {
+        if (salesReturnNotice.Id != null) base.DeleteById(salesReturnNotice.Id);
+
+        if (salesReturnNoticeDetails.Count > 0)
+            db.Deleteable<SalesOrderDetail>()
+                .Where(s => s.ErpId == salesReturnNotice.Id).ExecuteCommand();
+
+        var orUpdate = base.Insert(salesReturnNotice);
+        var baOrUpdate = salesReturnNoticeDetailManager.InsertRange(salesReturnNoticeDetails);
+        if (orUpdate && baOrUpdate) return true;
+        throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�");
+    }
+
+    // 鎵归噺淇濆瓨璁板綍鐨勬柟娉�
+    public bool SaveList(List<SaleReturnNotice> saleReturnNotices)
+    {
+        var result = saleReturnNotices.Select(Save).ToList();
+        return result.All(b => b);
+    }
+
+
+    // 灏� ErpSalesReturnNotice 瀵硅薄杞崲涓� SalesReturnNotice 瀵硅薄鐨勬柟娉�
+    public SalesReturnNotice GetSalesReturnNotice(ErpSalesReturnNotice erpSalesReturnNotice)
+    {
+
+        var eid = Convert.ToDecimal(erpSalesReturnNotice.Id);
+        var MesSalesReturnNotice = new SalesReturnNotice();
+
+        var single = base.GetSingle(it => it.Id == eid);
+        if (single != null) MesSalesReturnNotice.Id = single.Id;
+
+        MesSalesReturnNotice.ErpId = erpSalesReturnNotice.erpID;
+        MesSalesReturnNotice.BillType = erpSalesReturnNotice.fBillTypeID;
+        MesSalesReturnNotice.BillNo = erpSalesReturnNotice.fBillNo;
+
+        if (erpSalesReturnNotice.fDate != null)
+            MesSalesReturnNotice.FDate = DateTime.ParseExact(erpSalesReturnNotice.fDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesReturnNotice.Currency = erpSalesReturnNotice.fSettleCurrld;
+        MesSalesReturnNotice.SalesDept = erpSalesReturnNotice.fSaleDeptId;
+        MesSalesReturnNotice.ReturnCustomer = erpSalesReturnNotice.fRetcustId;
+        MesSalesReturnNotice.ReturnReason = erpSalesReturnNotice.fRetcustReason;
+        MesSalesReturnNotice.DeliveryLocation = erpSalesReturnNotice.fHeadLocId;
+        MesSalesReturnNotice.InventoryDept = erpSalesReturnNotice.fRetDeptId;
+        MesSalesReturnNotice.InventoryGroup = erpSalesReturnNotice.fStockerGroupId;
+        MesSalesReturnNotice.WarehouseManager = erpSalesReturnNotice.fStockerId;
+        MesSalesReturnNotice.SalesGroup = erpSalesReturnNotice.fSaleGroupId;
+        MesSalesReturnNotice.SalesPerson = erpSalesReturnNotice.fSalesManId;
+        MesSalesReturnNotice.Receiver = erpSalesReturnNotice.fReceiveCusId;
+        MesSalesReturnNotice.ReceiverContact = erpSalesReturnNotice.fReceiveCusContact;
+        MesSalesReturnNotice.ReceiverAddress = erpSalesReturnNotice.fReceiveAddress;
+        MesSalesReturnNotice.ReceiverName = erpSalesReturnNotice.fLinkMan;
+        MesSalesReturnNotice.SettleParty = erpSalesReturnNotice.fSettleCusId;
+        MesSalesReturnNotice.CreatedBy = erpSalesReturnNotice.fCreatorId;
+
+        if (erpSalesReturnNotice.fCreateDate != null)
+            MesSalesReturnNotice.CreatedDate = DateTime.ParseExact(erpSalesReturnNotice.fCreateDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesReturnNotice.ModifiedBy = erpSalesReturnNotice.fModifierId;
+
+        if (erpSalesReturnNotice.fModifyDate != null)
+            MesSalesReturnNotice.ModifiedDate = DateTime.ParseExact(erpSalesReturnNotice.fModifyDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesReturnNotice.ClosedBy = erpSalesReturnNotice.fCloserId;
+        MesSalesReturnNotice.CloseReason = erpSalesReturnNotice.fCloseReason;
+
+        if (erpSalesReturnNotice.fCloseDate != null)
+            MesSalesReturnNotice.CloseDate = DateTime.ParseExact(erpSalesReturnNotice.fCloseDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesReturnNotice.ApprovedBy = erpSalesReturnNotice.fApproverId;
+
+        if (erpSalesReturnNotice.fApproveDate != null)
+            MesSalesReturnNotice.ApprovedDate = DateTime.ParseExact(erpSalesReturnNotice.fApproveDate, "yyyy-MM-dd HH:mm:ss", null);
+        
+        MesSalesReturnNotice.CancelStatus = erpSalesReturnNotice.fCancelStatus;
+        MesSalesReturnNotice.CancelledBy = erpSalesReturnNotice.fCancellerId;
+
+        if (erpSalesReturnNotice.fCancelDate != null)
+            MesSalesReturnNotice.CancelDate = DateTime.ParseExact(erpSalesReturnNotice.fCancelDate, "yyyy-MM-dd HH:mm:ss", null);
+
+        MesSalesReturnNotice.CloseStatus = erpSalesReturnNotice.fBillCloseStatus;
+        MesSalesReturnNotice.BillStatus = erpSalesReturnNotice.fDocumentStatus;
+
+        return MesSalesReturnNotice;
+    }
+
+    // 灏� ErpSalesReturnNoticeDetail 瀵硅薄杞崲涓� SalesReturnNoticeDetail 瀵硅薄鐨勬柟娉�
+    public List<SalesReturnNoticeDetail> GetErpSalesOrderDetail(
+        List<ErpSalesReturnNoticeDetail> erpSalesReturnNoticeDetails, string type)
+    {
+        return erpSalesReturnNoticeDetails.Select(s =>
+        {
+            var entity = new SalesReturnNoticeDetail
+            {
+                Id = Convert.ToDecimal(s.Id),
+                ErpLineId = s.erpID,
+                ErpHeadId =s.ehid,
+                MaterialId = s.fMaterialId,
+                MaterialName = s.fMaterialName,
+                MaterialSpecification = s.fMaterialModel,
+                SalesUnitId = s.fUnitID,
+                SalesQuantity = Convert.ToDecimal(s.fQty),               
+                IsFree = s.fIsFree,
+                ReturnDate = s.fDeliverydate != null ? DateTime.ParseExact(s.fDeliverydate, "yyyy-MM-dd HH:mm:ss", null) : null,
+                WareHouse = s.fStockId,
+                PlanTrackingNumber = s.fMtoNo,
+                LotNumber = s.fLot,
+                Note = s.fEntryDescription,
+                ReturnType = s.fRmType,
+                InventoryUnit = s.fStockUnitID,
+                InventoryQuantity = Convert.ToDecimal(s.fStockQty),
+                MaterialCategory = s.fMaterialType,
+                OwnerTypeId = s.fOwnerTypeID,
+                OwnerId = s.fOwnerId,
+                SourceBillType = s.fSrcType,
+                SourceBillNo = s.fSrcBillNo,
+                OrderBillNo = s.fOrderNo,
+                
+            };
+
+            var single = salesReturnNoticeDetailManager.GetSingle(it =>
+                it.Id == entity.Id);
+            if (single != null) entity.Id = single.Id;
+
+            return entity;
+        }).ToList();
+    }
+
 }
\ No newline at end of file
diff --git a/MESApplication/Controllers/BasicData/SalesDeliveryNoticeController.cs b/MESApplication/Controllers/BasicData/SalesDeliveryNoticeController.cs
new file mode 100644
index 0000000..d73ca0c
--- /dev/null
+++ b/MESApplication/Controllers/BasicData/SalesDeliveryNoticeController.cs
@@ -0,0 +1,278 @@
+锘縰sing System.Dynamic;
+using MES.Service.Dto.webApi;
+using MES.Service.Modes;
+using MES.Service.service;
+using MES.Service.service.BasicData;
+using MES.Service.util;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+
+namespace MESApplication.Controllers.BasicData;
+
+[ApiController]
+[Route("api/[controller]")]
+public class SalesDeliveryNoticeController : ControllerBase
+{
+    private readonly MessageCenterManager _manager = new();
+
+    private readonly SalesDeliveryNoticeManager m = new();
+
+    private readonly string METHOD = "POST";
+
+    private readonly string TableName = "SALES_DELIVERY_NOTICE";
+
+    private readonly string URL = "http://localhost:10054/api/SalesDeliveryNotice/";
+
+    /// <summary>
+    ///     鍗曟潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("Save")]
+    public ResponseResult Save(SaleDeliveryNotice saleDeliveryNotice)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "Save";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(saleDeliveryNotice);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.Save(saleDeliveryNotice);
+
+            resultInfos.tbBillList = save;
+
+            entity.Result = 0;
+            if (save) entity.Result = 1;
+
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+
+            entity.DealWith = 0;
+
+            entity.ResultData = ex.Message;
+
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 1,
+                message = ex.Message,
+                data = ex.Message
+            };
+        }
+    }
+
+    /// <summary>
+    ///     澶氭潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("SaveList")]
+    public ResponseResult SaveList(List<SaleDeliveryNotice> units)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "SaveList";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(units);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.SaveList(units);
+            resultInfos.tbBillList = save;
+
+            entity.Result = 0;
+            if (save) entity.Result = 1;
+
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+
+            entity.DealWith = 0;
+
+            entity.ResultData = ex.Message;
+
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 1,
+                message = ex.Message,
+                data = ex.Message
+            };
+        }
+    }
+
+    /***杩涘叆妯$増绠$悊鍙互淇敼妯$増***/
+
+    /// <summary>
+    ///     鑾峰彇鎵�鏈�
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("GetList")]
+    public ResponseResult GetList()
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.GetList();
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+
+    /// <summary>
+    ///     鏍规嵁涓婚敭鑾峰彇
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("GetById")]
+    public ResponseResult GetById(int id)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.GetById(id);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     鏍规嵁涓婚敭鍒犻櫎
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("DeleteByIds")]
+    public ResponseResult DeleteByIds([FromBody] object[] ids)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.DeleteByIds(ids);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     娣诲姞
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("Insert")]
+    public ResponseResult Add([FromBody] SalesDeliveryNotice data)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.Insert(data);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     娣诲姞杩斿洖鑷
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("InsertReturnIdentity")]
+    public ResponseResult InsertReturnIdentity(
+        [FromBody] SalesDeliveryNotice data)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.InsertReturnIdentity(data);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     淇敼
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("Update")]
+    public ResponseResult Update([FromBody] SalesDeliveryNotice data)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.Update(data);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+}
diff --git a/MESApplication/Controllers/BasicData/SalesDeliveryNoticeDetailController.cs b/MESApplication/Controllers/BasicData/SalesDeliveryNoticeDetailController.cs
new file mode 100644
index 0000000..20f531f
--- /dev/null
+++ b/MESApplication/Controllers/BasicData/SalesDeliveryNoticeDetailController.cs
@@ -0,0 +1,163 @@
+锘縰sing System.Dynamic;
+using MES.Service.Modes;
+using MES.Service.service.BasicData;
+using MES.Service.util;
+using Microsoft.AspNetCore.Mvc;
+
+namespace MESApplication.Controllers.BasicData;
+
+[ApiController]
+[Route("api/[controller]")]
+public class SalesDeliveryNoticeDetailController : ControllerBase
+{
+    private readonly SalesDeliveryNoticeDetailManager m = new();
+
+
+    /***杩涘叆妯$増绠$悊鍙互淇敼妯$増***/
+
+    /// <summary>
+    ///     鑾峰彇鎵�鏈�
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("GetList")]
+    public ResponseResult GetList()
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.GetList();
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+
+    /// <summary>
+    ///     鏍规嵁涓婚敭鑾峰彇
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("GetById")]
+    public ResponseResult GetById(int id)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.GetById(id);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     鏍规嵁涓婚敭鍒犻櫎
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("DeleteByIds")]
+    public ResponseResult DeleteByIds([FromBody] object[] ids)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.DeleteByIds(ids);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     娣诲姞
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("Insert")]
+    public ResponseResult Add([FromBody] SalesDeliveryNoticeDetail data)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.Insert(data);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     娣诲姞杩斿洖鑷
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("InsertReturnIdentity")]
+    public ResponseResult InsertReturnIdentity(
+        [FromBody] SalesDeliveryNoticeDetail data)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.InsertReturnIdentity(data);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     淇敼
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("Update")]
+    public ResponseResult Update([FromBody] SalesDeliveryNoticeDetail data)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = m.Update(data);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+}
diff --git a/MESApplication/Controllers/BasicData/SalesOrderController.cs b/MESApplication/Controllers/BasicData/SalesOrderController.cs
index 74cc41f..814aa54 100644
--- a/MESApplication/Controllers/BasicData/SalesOrderController.cs
+++ b/MESApplication/Controllers/BasicData/SalesOrderController.cs
@@ -1,8 +1,11 @@
 锘縰sing System.Dynamic;
+using MES.Service.Dto.webApi;
 using MES.Service.Modes;
+using MES.Service.service;
 using MES.Service.service.BasicData;
 using MES.Service.util;
 using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
 
 namespace MESApplication.Controllers.BasicData;
 
@@ -10,8 +13,120 @@
 [Route("api/[controller]")]
 public class SalesOrderController : ControllerBase
 {
+
+    private readonly MessageCenterManager _manager = new();
     private readonly SalesOrderManager m = new();
 
+    private readonly string METHOD = "POST";
+
+    private readonly string TableName = "SALES_ORDER";
+
+    private readonly string URL = "http://localhost:10054/api/SalesOrder/";
+
+    /// <summary>
+    ///     鍗曟潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("Save")]
+    public ResponseResult Save(SalesOrders salesOrders)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "Save";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(salesOrders);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.Save(salesOrders);
+
+            resultInfos.tbBillList = save;
+
+            entity.Result = 0;
+            if (save) entity.Result = 1;
+
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+
+            entity.DealWith = 0;
+
+            entity.ResultData = ex.Message;
+
+            _manager.save(entity);
+
+            return  new ResponseResult
+            {
+                status = 1,
+                message = ex.Message,
+                data = ex.Message
+            }; 
+        }
+    }
+
+    /// <summary>
+    ///     澶氭潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("SaveList")]
+    public ResponseResult SaveList(List<SalesOrders> units)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "SaveList";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(units);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.SaveList(units);
+            resultInfos.tbBillList = save;
+
+            entity.Result = 0;
+            if (save) entity.Result = 1;
+
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+
+            entity.DealWith = 0;
+
+            entity.ResultData = ex.Message;
+
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 1,
+                message = ex.Message,
+                data = ex.Message
+            };
+        }
+    }
 
     /***杩涘叆妯$増绠$悊鍙互淇敼妯$増***/
 
diff --git a/MESApplication/Controllers/BasicData/SalesReturnNoticeController.cs b/MESApplication/Controllers/BasicData/SalesReturnNoticeController.cs
index 8df7421..e3fdce5 100644
--- a/MESApplication/Controllers/BasicData/SalesReturnNoticeController.cs
+++ b/MESApplication/Controllers/BasicData/SalesReturnNoticeController.cs
@@ -1,8 +1,11 @@
 锘縰sing System.Dynamic;
+using MES.Service.Dto.webApi;
 using MES.Service.Modes;
+using MES.Service.service;
 using MES.Service.service.BasicData;
 using MES.Service.util;
 using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
 
 namespace MESApplication.Controllers.BasicData;
 
@@ -10,8 +13,120 @@
 [Route("api/[controller]")]
 public class SalesReturnNoticeController : ControllerBase
 {
+    private readonly MessageCenterManager _manager = new();
+
     private readonly SalesReturnNoticeManager m = new();
 
+    private readonly string METHOD = "POST";
+
+    private readonly string TableName = "SALES_RETURN_NOTICE";
+
+    private readonly string URL = "http://localhost:10054/api/SalesReturnNotice/";
+
+    /// <summary>
+    ///     鍗曟潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("Save")]
+    public ResponseResult Save(SaleReturnNotice saleReturnNotice)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "Save";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(saleReturnNotice);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.Save(saleReturnNotice);
+
+            resultInfos.tbBillList = save;
+
+            entity.Result = 0;
+            if (save) entity.Result = 1;
+
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+
+            entity.DealWith = 0;
+
+            entity.ResultData = ex.Message;
+
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 1,
+                message = ex.Message,
+                data = ex.Message
+            };
+        }
+    }
+
+    /// <summary>
+    ///     澶氭潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("SaveList")]
+    public ResponseResult SaveList(List<SaleReturnNotice> units)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "SaveList";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(units);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.SaveList(units);
+            resultInfos.tbBillList = save;
+
+            entity.Result = 0;
+            if (save) entity.Result = 1;
+
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+
+            entity.DealWith = 0;
+
+            entity.ResultData = ex.Message;
+
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 1,
+                message = ex.Message,
+                data = ex.Message
+            };
+        }
+    }
 
     /***杩涘叆妯$増绠$悊鍙互淇敼妯$増***/
 
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.dll b/MESApplication/bin/Debug/net8.0/MES.Service.dll
index d622a0f..0a2ca83 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.dll
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.pdb b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
index 6c21664..546e71f 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.pdb
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.dll b/MESApplication/bin/Debug/net8.0/MESApplication.dll
index 62ba993..348ee2c 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.dll
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.exe b/MESApplication/bin/Debug/net8.0/MESApplication.exe
index 700d0b3..228ec58 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.exe
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.pdb b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
index ef7633c..d3b4a9a 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.pdb
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.xml b/MESApplication/bin/Debug/net8.0/MESApplication.xml
index 86c6a4f..086076f 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.xml
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.xml
@@ -462,6 +462,102 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.Save(MES.Service.Dto.webApi.SaleDeliveryNotice)">
+            <summary>
+                鍗曟潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.SaveList(System.Collections.Generic.List{MES.Service.Dto.webApi.SaleDeliveryNotice})">
+            <summary>
+                澶氭潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.GetList">
+            <summary>
+                鑾峰彇鎵�鏈�
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.GetById(System.Int32)">
+            <summary>
+                鏍规嵁涓婚敭鑾峰彇
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.DeleteByIds(System.Object[])">
+            <summary>
+                鏍规嵁涓婚敭鍒犻櫎
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.Add(MES.Service.Modes.SalesDeliveryNotice)">
+            <summary>
+                娣诲姞
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.InsertReturnIdentity(MES.Service.Modes.SalesDeliveryNotice)">
+            <summary>
+                娣诲姞杩斿洖鑷
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.Update(MES.Service.Modes.SalesDeliveryNotice)">
+            <summary>
+                淇敼
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeDetailController.GetList">
+            <summary>
+                鑾峰彇鎵�鏈�
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeDetailController.GetById(System.Int32)">
+            <summary>
+                鏍规嵁涓婚敭鑾峰彇
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeDetailController.DeleteByIds(System.Object[])">
+            <summary>
+                鏍规嵁涓婚敭鍒犻櫎
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeDetailController.Add(MES.Service.Modes.SalesDeliveryNoticeDetail)">
+            <summary>
+                娣诲姞
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeDetailController.InsertReturnIdentity(MES.Service.Modes.SalesDeliveryNoticeDetail)">
+            <summary>
+                娣诲姞杩斿洖鑷
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeDetailController.Update(MES.Service.Modes.SalesDeliveryNoticeDetail)">
+            <summary>
+                淇敼
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesOrderController.Save(MES.Service.Dto.webApi.SalesOrders)">
+            <summary>
+                鍗曟潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesOrderController.SaveList(System.Collections.Generic.List{MES.Service.Dto.webApi.SalesOrders})">
+            <summary>
+                澶氭潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+            </summary>
+            <returns></returns>
+        </member>
         <member name="M:MESApplication.Controllers.BasicData.SalesOrderController.GetList">
             <summary>
                 鑾峰彇鎵�鏈�
@@ -534,6 +630,18 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesReturnNoticeController.Save(MES.Service.Dto.webApi.SaleReturnNotice)">
+            <summary>
+                鍗曟潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MESApplication.Controllers.BasicData.SalesReturnNoticeController.SaveList(System.Collections.Generic.List{MES.Service.Dto.webApi.SaleReturnNotice})">
+            <summary>
+                澶氭潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
+            </summary>
+            <returns></returns>
+        </member>
         <member name="M:MESApplication.Controllers.BasicData.SalesReturnNoticeController.GetList">
             <summary>
                 鑾峰彇鎵�鏈�

--
Gitblit v1.9.3