From 526f787a2dfb97f6492912a73376b5a5551a432c Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 09 十二月 2022 18:00:52 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/BaseSet/Gy_CustomerController.cs | 23 ++++++++++++++++++++++-
Model/基础资料/基础资料/ClsGy_CustLocation_Model.cs | 1 +
2 files changed, 23 insertions(+), 1 deletions(-)
diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_CustLocation_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_CustLocation_Model.cs"
index 0b53f6b..d841d7a 100644
--- "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_CustLocation_Model.cs"
+++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_CustLocation_Model.cs"
@@ -16,5 +16,6 @@
public string HStopEmp { get; set; }
public int HUSEORGID { get; set; }
public int HCREATEORGID { get; set; }
+ public int HENTRYID { get; set; }
}
}
diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
index 83bade0..4962247 100644
--- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
@@ -323,16 +323,18 @@
try
{
var model = oMain["model"].ToString();
+ var custLocationModel = oMain["model"]["HCustLocationEntry"].ToString();
//鍙嶅簭鍒楀寲
model = "[" + model + "]";
List<Customer> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Customer>>(model);
+ List<Model.ClsGy_CustLocation_Model> custLocationls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_CustLocation_Model>>(custLocationModel);
string sql = string.Empty;
oCN.BeginTran();
sql = $"delete gy_Customer where HItemID = {lsmain[0].HItemID}";
oCN.RunProc(sql);
sql = "set identity_insert gy_Customer on";
oCN.RunProc(sql);
- //涓昏〃
+ //涓昏〃_瀹㈡埛
oCN.RunProc("Insert into Gy_Customer " +
" (HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" +
",HLevel,HEndFlag,HStopflag,HRemark" +
@@ -356,6 +358,25 @@
", " + lsmain[0].HCusTypeID + ")");
sql = "set identity_insert gy_Customer off";
oCN.RunProc(sql);
+ //瀹㈡埛_浜よ揣鍦扮偣
+ sql = $"delete Gy_CustLocation where HItemID = {lsmain[0].HItemID}";
+ oCN.RunProc(sql);
+ sql = "set identity_insert Gy_CustLocation on";
+ oCN.RunProc(sql);
+ foreach (var item in custLocationls)
+ {
+ sql = $@"insert into Gy_CustLocation(HItemID,HEntryID,HNumber,HName ,HShortNumber,HParentID ,HLevel
+ ,HEndFlag,HStopflag,HRemark ,HHelpCode ,HUseFlag
+ ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp
+ ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID)
+ values({item.HItemID},{item.HENTRYID},'{item.HNumber}','{item.HName}','{item.HShortNumber}',{item.HParentID},{item.HLevel}
+ ,{Convert.ToString(item.HEndFlag ? 1 : 0)},{Convert.ToString(item.HStopflag ? 1 : 0) },'{item.HRemark}','{item.HHelpCode}','{item.HUseFlag}'
+ ,'{item.HMakeTime}','{item.HMakeEmp}','{item.HCheckEmp}','{item.HCheckTime}','{item.HModifyEmp}'
+ ,'{item.HModifyTime}','{item.HStopEmp}',null,{item.HUSEORGID},{item.HCREATEORGID})";
+ oCN.RunProc(sql);
+ }
+ sql = "set identity_insert Gy_CustLocation off";
+ oCN.RunProc(sql);
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
--
Gitblit v1.9.1