From 1948124877478db58b27841f9398aed97ef13053 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期日, 26 十月 2025 17:19:15 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/基础资料/基础资料/Gy_MatePriceSupController.cs |  102 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 92 insertions(+), 10 deletions(-)

diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceSupController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceSupController.cs"
index cee9193..04e16c1 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceSupController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceSupController.cs"
@@ -338,24 +338,36 @@
             try
             {
                 var _value = msg["model"].ToString();
-                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                LogService.Write("閲囪喘浠锋牸" + _value);
+               SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 ListModels oListModels = new ListModels();
                 List<Model.ClsGy_MatePriceSup_Model> lsmain = new List<Model.ClsGy_MatePriceSup_Model>();
                 lsmain = oListModels.getObjectByJson_Gy_MatePriceSup(_value);
                 string sql = string.Empty;
                 //淇濆瓨
                 oCN.BeginTran();
-                sql = $"delete Gy_MatePriceSup where HItemID = {lsmain[0].HItemID}";
-                oCN.RunProc(sql);
-                sql = "set identity_insert Gy_MatePriceSup on";
-                oCN.RunProc(sql);
 
-                oCN.RunProc($@"insert into Gy_MatePriceSup(HItemID,HInterID,HEntryID,HMaterID,HRelationID,HUnitID,HBeginQty,HEndQty,HCurID,HType
+                foreach (var item in lsmain)
+                {
+                    sql = $"delete Gy_MatePriceSup where HItemID = {item.HItemID}";
+                    oCN.RunProc(sql);
+                    sql = "set identity_insert Gy_MatePriceSup on";
+                    oCN.RunProc(sql);
+
+
+                    LogService.Write("閲囪喘浠锋牸" + $@"  insert into Gy_MatePriceSup(HItemID,HNumber,HInterID,HEntryID,HMaterID,HRelationID,HUnitID,HBeginQty,HEndQty,HCurID,HType
                         ,HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate)
-                  values({lsmain[0].HItemID},{lsmain[0].HInterID},{lsmain[0].HEntryID},{lsmain[0].HMaterID},{lsmain[0].HRelationID},{lsmain[0].HUnitID},{lsmain[0].HBeginQty},{lsmain[0].HEndQty},{lsmain[0].HCurID},'{lsmain[0].HType}',{lsmain[0].HPrice},'{lsmain[0].HBeginDate}','{lsmain[0].HEndDate}','{lsmain[0].HUsed}','{lsmain[0].HRemark}','{lsmain[0].HMaker}','{lsmain[0].HMakeDate}')", ref DBUtility.ClsPub.sExeReturnInfo);
-                //淇敼涓婄骇涓洪潪鏈骇浠g爜
-                sql = "set identity_insert Gy_MatePriceSup off";
-                oCN.RunProc(sql);
+                  values({item.HItemID},'{item.HNumber}',{item.HInterID},{item.HEntryID},{item.HMaterID},{item.HRelationID},{item.HUnitID},{item.HBeginQty},{item.HEndQty},{item.HCurID},'{item.HType}',{item.HPrice},'{item.HBeginDate}','{item.HEndDate}','{item.HUsed}','{item.HRemark}','{item.HMaker}','{item.HMakeDate}')");
+
+
+                    oCN.RunProc($@"insert into Gy_MatePriceSup(HItemID,HNumber,HInterID,HEntryID,HMaterID,HRelationID,HUnitID,HBeginQty,HEndQty,HCurID,HType
+                        ,HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate)
+                  values({item.HItemID},'{item.HNumber}',{item.HInterID},{item.HEntryID},{item.HMaterID},{item.HRelationID},{item.HUnitID},{item.HBeginQty},{item.HEndQty},{item.HCurID},'{item.HType}',{item.HPrice},'{item.HBeginDate}','{item.HEndDate}','{item.HUsed}','{item.HRemark}','{item.HMaker}','{item.HMakeDate}')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    sql = "set identity_insert Gy_MatePriceSup off";
+                    oCN.RunProc(sql);
+
+                }
                 oCN.Commit();
 
                 objJsonResult.code = "1";
@@ -526,5 +538,75 @@
             }
         }
         #endregion
+
+
+        #region 閲囪喘浠风洰 閲戣澏鍚屾
+        [Route("Gy_MatePriceSup/SaveGy_PurPriceApi")]
+        [HttpPost]
+        public object SaveGy_PurPriceApi([FromBody] JObject msg)
+        {
+            try
+            {
+                var _value = msg["model"].ToString();
+                LogService.Write("閲囪喘浠风洰" + _value);
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                ListModels oListModels = new ListModels();
+                List<Model.ClsGy_PurPrice_Model> lsmain = new List<Model.ClsGy_PurPrice_Model>();
+                lsmain = oListModels.getObjectByJson_Gy_PurPrice(_value);
+                string sql = string.Empty;
+                //淇濆瓨
+                oCN.BeginTran();
+
+                foreach (var item in lsmain)
+                {
+                    sql = $"delete Gy_PurPriceList where HItemID = {item.HItemID}";
+                    oCN.RunProc(sql);
+                    sql = "set identity_insert Gy_PurPriceList on";
+                    oCN.RunProc(sql);
+
+                    LogService.Write("閲囪喘浠风洰"   + $@"  insert into Gy_PurPriceList(HItemID, HNumber, HName, HShortNumber, HParentID, HLevel,
+                    HEndFlag, HStopflag, HRemark, HUseFlag, HCREATEORGID, HUSEORGID,
+                    HMakeEmp, HMakeTime, HCheckEmp, HCheckTime,HModifyEmp, HModifyTime, HStopEmp, HStopTime,
+                    HPURCHASEORGID, HSupID, HCurID, HPRICER, HPRICETYPE, HPRICEOBJECT,HISINCLUDEDTAX, HDEFPRICELISTID, HSUPPLIERMASTERID) 
+                    values({item.HItemID},'{item.HNumber}','{item.HName}','{item.HShortNumber}',{item.HParentID},{item.HLevel}, 
+                    '{item.HEndFlag}','{item.HStopflag}','{item.HRemark}','{item.HUseFlag}',{item.HCREATEORGID},{item.HUSEORGID}, 
+                    {item.HMakeEmp},'{item.HMakeTime}',{item.HCheckEmp},'{item.HCheckTime}',{item.HModifyEmp},'{item.HModifyTime}',{item.HStopEmp},'{item.HStopTime}', 
+                    {item.HPURCHASEORGID},{item.HSupID},{item.HCurID},{item.HPRICER},{item.HPRICETYPE},'{item.HPRICEOBJECT}','{item.HISINCLUDEDTAX}','{item.HDEFPRICELISTID}','{item.HSUPPLIERMASTERID}')");
+
+                    oCN.RunProc($@"insert into Gy_PurPriceList(HItemID, HNumber, HName, HShortNumber, HParentID, HLevel,
+                    HEndFlag, HStopflag, HRemark, HUseFlag, HCREATEORGID, HUSEORGID,
+                    HMakeEmp, HMakeTime, HCheckEmp, HCheckTime,HModifyEmp, HModifyTime, HStopEmp, HStopTime,
+                    HPURCHASEORGID, HSupID, HCurID, HPRICER, HPRICETYPE, HPRICEOBJECT,HISINCLUDEDTAX, HDEFPRICELISTID, HSUPPLIERMASTERID) 
+                    values({item.HItemID},'{item.HNumber}','{item.HName}','{item.HShortNumber}',{item.HParentID},{item.HLevel}, 
+                    '{item.HEndFlag}','{item.HStopflag}','{item.HRemark}','{item.HUseFlag}',{item.HCREATEORGID},{item.HUSEORGID}, 
+                    {item.HMakeEmp},'{item.HMakeTime}',{item.HCheckEmp},'{item.HCheckTime}',{item.HModifyEmp},'{item.HModifyTime}',{item.HStopEmp},'{item.HStopTime}', 
+                    {item.HPURCHASEORGID},{item.HSupID},{item.HCurID},{item.HPRICER},{item.HPRICETYPE},'{item.HPRICEOBJECT}','{item.HISINCLUDEDTAX}','{item.HDEFPRICELISTID}','{item.HSUPPLIERMASTERID}')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    sql = "set identity_insert Gy_PurPriceList off";
+                    oCN.RunProc(sql);
+
+                }
+
+
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1