From 3a6f7cb36dff0ec99edddbb53078947fcf08a47e Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期六, 19 七月 2025 09:32:15 +0800 Subject: [PATCH] 1.用料清单变更 --- MES.Service/service/BasicData/MesSupplierManager.cs | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/MES.Service/service/BasicData/MesSupplierManager.cs b/MES.Service/service/BasicData/MesSupplierManager.cs index ab29530..ee14371 100644 --- a/MES.Service/service/BasicData/MesSupplierManager.cs +++ b/MES.Service/service/BasicData/MesSupplierManager.cs @@ -23,14 +23,11 @@ if (UpdateSupplierStatus(db, entity.Id, "B")) return 1; break; - case "2": - if (InsertSupplier(db, entity)) - return 1; - break; case "3": if (DeleteSupplier(entity.Id)) return 1; break; + case "2": case "4": if (InsertOrUpdate(db, entity)) return 1; @@ -65,14 +62,11 @@ "B")) throw new NotImplementedException("绂佺敤澶辫触"); break; - case "2": - if (!InsertSupplierBatch(db, supplierGroup.Value)) - throw new NotImplementedException("鎻掑叆澶辫触"); - break; case "3": if (!DeleteSupplierBatch(db, supplierGroup.Value)) throw new NotImplementedException("鍒犻櫎澶辫触"); break; + case "2": case "4": if (!InsertOrUpdateBatch(db, supplierGroup.Value)) throw new NotImplementedException("鍚屾澶辫触"); @@ -110,7 +104,10 @@ private bool DeleteSupplier(decimal supplierId) { - if (base.DeleteById(supplierId)) return true; + var deleteById = Db.Deleteable<MesSupplier>() + .Where(s => s.Id == supplierId).ExecuteCommand(); + if (deleteById > 0) + return true; throw new NotImplementedException("鍒犻櫎澶辫触"); } @@ -123,12 +120,11 @@ SuppNo = supplier.FNumber, SuppSname = supplier.FShortName, SuppName = supplier.FName, - Lxr = supplier.FContact, - Telf1 = supplier.FTel, + Lxr = supplier.FTContact, + Telf1 = supplier.Fmobilephone, Fstaffid = supplier.FStaffId, Fforbidstatus = supplier.FForbidStatus, Type = supplier.Type, - Remark = supplier.FDescription, FSubsidiary = supplier.FUseOrgId, Fumbrella = supplier.FCreateOrgId, CreateDate = DateTime.Now, @@ -167,7 +163,7 @@ { var ids = supplierList.Select(it => it.Id).ToArray(); var deleteByIds = db.Deleteable<MesSupplier>() - .Where(s=>ids.Contains(s.Id)).ExecuteCommand(); + .Where(s => ids.Contains(s.Id)).ExecuteCommand(); if (deleteByIds > 0) return true; -- Gitblit v1.9.3