From 37a2e1209d1cddb71f7740543e8df2e3a03cfd1f Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期三, 13 三月 2024 09:58:50 +0800
Subject: [PATCH] 新增或修改物料信息时 物料编码唯一

---
 Wms/WMS.BLL/SysServer/MaterialsServer.cs |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/Wms/WMS.BLL/SysServer/MaterialsServer.cs b/Wms/WMS.BLL/SysServer/MaterialsServer.cs
index e33d8b6..eb05ab5 100644
--- a/Wms/WMS.BLL/SysServer/MaterialsServer.cs
+++ b/Wms/WMS.BLL/SysServer/MaterialsServer.cs
@@ -146,6 +146,14 @@
             //鎹曡幏寮傚父
             try
             {
+                int count = GetMateByNo(matedto.SkuNo);
+
+                if (count > 0)
+                {
+                    throw new Exception("鐗╂枡缂栫爜閲嶅");
+                }
+
+
                 //鏄犲皠妯″瀷
                 SysMaterials mate = _mapper.Map<SysMaterials>(matedto);
                 mate.AuditStatusNo = "9"; //瀹℃牳鐘舵��
@@ -201,6 +209,14 @@
             //鎹曡幏寮傚父
             try
             {
+
+                int count = GetMateByNo(matedto.SkuNo);
+
+                if (count > 0)
+                {
+                    throw new Exception("鐗╂枡缂栫爜閲嶅");
+                }
+
                 if (matedto.AdventTime > 365 && matedto.AdventTime < 30)
                 {
                     return 2;

--
Gitblit v1.8.0