From 39f20d0d2e0143e45fb317336f154170d6b82485 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期二, 11 十一月 2025 08:55:29 +0800
Subject: [PATCH] 小卫托条码生成
---
WebAPI/Controllers/BaseSet/Gy_PropertyController.cs | 45 +++++++++++++++++++++++++++++++++++----------
1 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_PropertyController.cs b/WebAPI/Controllers/BaseSet/Gy_PropertyController.cs
index 194f09e..4f3c7a4 100644
--- a/WebAPI/Controllers/BaseSet/Gy_PropertyController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_PropertyController.cs
@@ -370,35 +370,59 @@
[HttpPost]
public object SaveGy_PropertyListApi([FromBody] JObject msg)
{
+ LogService.Write("寮�濮嬪悓姝�");
try
{
var _value = msg["model"].ToString();
+ LogService.Write("1" + _value);
+ var entry = msg["model"]["HENTRY"].ToString();
+ LogService.Write("1" + _value);
+ LogService.Write("12" + entry);
+ entry = entry.Replace("\"hendflag\": \"1\"", "\"hendflag\": true")
+ .Replace("\"hstopflag\": \"0\"", "\"hstopflag\": false")
+ .Replace("\"hendflag\": \"0\"", "\"hendflag\": false")
+ .Replace("\"hstopflag\": \"1\"", "\"hstopflag\": true");
+
+ LogService.Write($"澶勭悊鍚庣殑JSON: {_value}");
+ _value = "[" + _value.ToString() + "]";
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- ListModels oListModels = new ListModels();
- List<Model.ClsGy_Property_Model> lsmain = new List<Model.ClsGy_Property_Model>();
- lsmain = oListModels.getObjectByJson_Gy_Property(_value);
+ List<Model.ClsGy_PropertyType_Model> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_PropertyType_Model>>(_value);
+ List<Model.ClsGy_Property_Model> lssub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_Property_Model>>(entry);
string sql = string.Empty;
+ LogService.Write(lsmain);
//淇濆瓨
oCN.BeginTran();
- sql = $"delete Gy_Property where HItemID = {lsmain[0].HItemID}";
- oCN.RunProc(sql);
+ foreach (var osub in lssub)
+ {
+ sql = $"delete Gy_Property where HItemID = {osub.HItemID}";
+ oCN.RunProc(sql);
+ }
+ foreach (var osub in lsmain)
+ {
+ sql = $"delete Gy_PropertyEntry where HItemID = {osub.HItemID}";
+ oCN.RunProc(sql);
+ }
+
+
sql = "set identity_insert Gy_Property on";
oCN.RunProc(sql);
- oCN.RunProc($@"insert into Gy_Property(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID
+ oCN.RunProc($@"insert into Gy_Property(HItemID,HNumber,HShortNumber,HName,HHelpCode,HParentID
,HLevel,HEndFlag,HStopflag,HRemark,HPropertyTypeID,HUseFlag,HERPItemID,HMakeTime)
- values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HHelpCode}','{lsmain[0].HShortNumber}',{lsmain[0].HParentID},{lsmain[0].HLevel}
- ,{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HRemark}',{lsmain[0].HPropertyTypeID},'{lsmain[0].HUseFlag}',{lsmain[0].HERPItemID},'{lsmain[0].HMakeTime}')", ref DBUtility.ClsPub.sExeReturnInfo);
-
+ values({lssub[0].HItemID},'{lssub[0].HNumber}','{lssub[0].HShortNumber}','{lssub[0].HName}','{lssub[0].HHelpCode}',{lssub[0].HParentID},{lssub[0].HLevel}
+ ,{Convert.ToString(lssub[0].HEndFlag ? 1 : 0)},{Convert.ToString(lssub[0].HStopflag ? 1 : 0) },'{lssub[0].HRemark}',{lssub[0].HPropertyTypeID},'{lssub[0].HUseFlag}',{lssub[0].HERPItemID},'{lssub[0].HMakeTime}')", ref DBUtility.ClsPub.sExeReturnInfo);
+ LogService.Write("杈呭姪灞炴�ц〃鎻掑叆鎴愬姛");
//鏂板杈呭姪瀛愯〃锛�
oCN.RunProc($@"insert into Gy_PropertyEntry
(HItemID,HERPItemID,HAuxpuID,HMaterID,HISDefault,HStopflag,HSno)
- values({lsmain[1].HItemID},'{lsmain[1].HERPItemID}','{lsmain[1].HAuxpuID}','{lsmain[1].HMaterID}','{lsmain[1].HISDefault}',{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[1].HSno}')", ref DBUtility.ClsPub.sExeReturnInfo);
+ values({lsmain[0].HItemID},'{lsmain[0].HERPItemID}','{lsmain[0].HAuxpuID}','{lsmain[0].HMaterID}','{lsmain[0].HISDefault}',{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HSno}')", ref DBUtility.ClsPub.sExeReturnInfo);
//淇敼涓婄骇涓洪潪鏈骇浠g爜
sql = "set identity_insert Gy_Property off";
+ LogService.Write("杈呭姪灞炴�у�艰〃鎻掑叆鎴愬姛");
oCN.RunProc(sql);
oCN.Commit();
+
@@ -412,6 +436,7 @@
}
catch (Exception e)
{
+ LogService.Write("寮傚父淇℃伅锛�" + e.ToString());
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
--
Gitblit v1.9.1