From c1c47f14ef55f4e403f8bf39369d840d9f8bcadc Mon Sep 17 00:00:00 2001
From: sjz <1240968267@qq.com>
Date: 星期四, 23 一月 2025 20:48:16 +0800
Subject: [PATCH] 更正物料和物料类型接口

---
 StandardPda/MES.Service/service/BasicData/MesRohInManager.cs |   54 +++++-------------------------------------------------
 1 files changed, 5 insertions(+), 49 deletions(-)

diff --git a/StandardPda/MES.Service/service/BasicData/MesRohInManager.cs b/StandardPda/MES.Service/service/BasicData/MesRohInManager.cs
index 873583a..8e84976 100644
--- a/StandardPda/MES.Service/service/BasicData/MesRohInManager.cs
+++ b/StandardPda/MES.Service/service/BasicData/MesRohInManager.cs
@@ -2,7 +2,6 @@
 using MES.Service.Dto.webApi;
 using MES.Service.Modes;
 using SqlSugar;
-using System.Security.AccessControl;
 
 namespace MES.Service.service.BasicData;
 
@@ -15,7 +14,8 @@
     {
         var rohInErpRohIn = rohIn.ErpRohIn;
         var mesRohIn = GetMesRohIn(rohInErpRohIn);
-        var mesRohInDatas = GetMesRohInDatas(rohIn.ErpRohinDatas, rohInErpRohIn.Type);
+        var mesRohInDatas =
+            GetMesRohInDatas(rohIn.ErpRohinDatas, rohInErpRohIn.Type);
 
         return UseTransaction(db =>
         {
@@ -30,50 +30,6 @@
                     $"type娌℃湁{rohInErpRohIn.Type}杩欎釜绫诲瀷")
             };
         }) > 0;
-    }
-
-    // 鎻掑叆鏁版嵁鐨勬柟娉�
-    private bool InsertData(SqlSugarScope db, MesRohIn mesRohIn,
-        List<MesRohInData> mesRohInDatas, string FBILLTYPE)
-    {
-        switch (FBILLTYPE)
-        {
-            case "A":
-            {
-                var decimals = mesRohInDatas.Select(s => s.Id).ToArray();
-
-                if (mesRohIn.Id != null) base.DeleteById(mesRohIn.Id);
-
-                if (decimals.Length > 0)
-                    db.Deleteable<MesRohInData>().In(decimals).ExecuteCommand();
-
-                var insert = base.Insert(mesRohIn);
-                var insertRange =
-                    rohInDataManager.InsertRange(mesRohInDatas);
-
-                if (insert && insertRange) return true;
-                throw new NotImplementedException("鎻掑叆澶辫触");
-            }
-            case "B":
-            {
-                var decimals = mesRohInDatas.Select(s => s.Id).ToArray();
-                if (base.DeleteById(mesRohIn.Id) && db
-                        .Deleteable<MesRohInData>().In(decimals)
-                        .ExecuteCommand() > 0)
-                {
-                    var insert = base.Insert(mesRohIn);
-                    var insertRange =
-                        rohInDataManager.InsertRange(mesRohInDatas);
-
-                    if (insert && insertRange) return true;
-                    throw new NotImplementedException("鎻掑叆澶辫触");
-                }
-
-                break;
-            }
-        }
-
-        throw new NotImplementedException("閲囪喘璁㈠崟绫诲瀷閿欒");
     }
 
     // 鏇存柊鏁版嵁鐨勬柟娉�
@@ -112,7 +68,7 @@
         //var orUpdate = base.Insert(mesRohIn);
         //var baOrUpdate = rohInDataManager.InsertRange(mesRohInDatas);
         var orUpdate = db.Insertable(mesRohIn)
-    .IgnoreColumns(true).ExecuteCommand() > 0;
+            .IgnoreColumns(true).ExecuteCommand() > 0;
 
 
         var baOrUpdate = db.Insertable(mesRohInDatas).PageSize(1)
@@ -146,7 +102,8 @@
         mesRohIn.DocumentType = rohIn.FBillTypeID;
         mesRohIn.BusinessType = rohIn.FBusinessType;
         if (rohIn.FDate != null)
-            mesRohIn.PurchaseDate = DateTime.ParseExact(rohIn.FDate,"yyyy-MM-dd HH:mm:ss", null);
+            mesRohIn.PurchaseDate = DateTime.ParseExact(rohIn.FDate,
+                "yyyy-MM-dd HH:mm:ss", null);
         mesRohIn.Supplier = rohIn.FSupplierId;
         mesRohIn.CloseStatus = rohIn.FCloseStatus;
         mesRohIn.PurchaseOrg = rohIn.FPurchaseOrgId;
@@ -273,7 +230,6 @@
                 FCGDDSctzda = s.F_CGDD_SCTZDA,
                 FCGDDXHA = s.F_CGDD_XHA,
                 FXifgTextApv = s.F_XIFG_Text_apv
-
             };
 
             var single = rohInDataManager.GetSingle(it =>

--
Gitblit v1.9.3