From 4cca607ddce9577864b8a5c9c8edf7c83915b787 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 23 十月 2025 12:32:34 +0800
Subject: [PATCH] 修改物料信息删除方法

---
 新建文件夹/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs"
index 06b34dc..e6c5208 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs"
@@ -1,12 +1,18 @@
-锘縰sing System;
+锘縰sing HslCommunication;
+using Newtonsoft.Json;
+using Quartz.Util;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.Helper;
 using WIDESEA_IWMsInfoServices;
 using WIDESEA_Model.Models;
+using static WIDESEA_DTO.SquareCabin.TowcsDto;
 
 namespace WIDESEA_WMsInfoServices
 {
@@ -15,5 +21,58 @@
         public MaterielInfoService(IRepository<Dt_MaterielInfo> BaseDal) : base(BaseDal)
         {
         }
+        public IRepository<Dt_MaterielInfo> Repository => BaseDal;
+        public override WebResponseContent DeleteData(object[] keys)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                if (keys.ToList().Count > 1) throw new Exception("涓�娆″彧鑳介�夋嫨涓�鏉℃暟鎹�");
+                Dt_MaterielInfo goods = BaseDal.QueryFirst(x => keys.Contains(x.Id));
+                var medicineDTO = new ProductInfo
+                {
+                    //鐢ㄦ埛code
+                    customerCode = "905",
+                    //鐗╂枡绫诲瀷
+                    materialCode = "YY",
+                    //浜у搧缂栫爜
+                    productCode = goods.MaterielCode,
+                    //浜у搧鍚�
+                    productName = goods.MaterielName,
+                    //浜у搧鏉$爜
+                    productBarCode = goods.MaterielCode,
+
+                    //瑙勬牸
+                    productSpecifications = goods.MaterielSpec,
+                    //鍗曚綅
+                    unit = goods.MaterielUnit,
+                    //闀�
+                    singleProductLongNum = goods.MaterielLength.ToString(),
+                    //瀹�
+                    singleProductWideNum = goods.MaterielWide.ToString(),
+                    //楂�
+                    singleProductHighNum = goods.MaterielHeight.ToString(),
+                    //閲嶉噺
+                    singleProductWeight = goods.MaterielWeight.ToString(),
+                    //浣撶Н
+                    singleProductVolume = goods.MaterielVolume.ToString(),
+                    //鏄惁鍙栨秷 0鏄笉鍒犻櫎锛�1鍒犻櫎
+                    isDelete = "1"
+                };
+                var url = "http://172.16.1.2:9357/file-admin/api/product/productSynchronous";
+                //var url = "http://172.16.1.245:9357/file-admin/api/product/productSynchronous";
+
+                var result = HttpHelper.Post(url, medicineDTO.ToJsonString());
+                var resp = JsonConvert.DeserializeObject<TowcsResponse<object>>(result);
+                if (resp != null && resp.code == "0") return base.DeleteData(keys);
+
+                return WebResponseContent.Instance.Error("鍒犻櫎澶辫触璇烽噸璇�");
+            }
+            catch (Exception ex)
+            {
+                content.Error(ex.Message);
+            }
+            return content;
+        }
     }
 }

--
Gitblit v1.9.3