From 4548e24916ac5f63eef736cabdcd634864f8de16 Mon Sep 17 00:00:00 2001
From: wangbin <lan@DESKTOP-MG88OFJ>
Date: 星期一, 08 七月 2024 10:39:16 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/生产管理/报工台工序/Sc_MESEndStepWorkBillController.cs | 48 ++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 44 insertions(+), 4 deletions(-)
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESEndStepWorkBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESEndStepWorkBillController.cs"
index 7274439..4382e02 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESEndStepWorkBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESEndStepWorkBillController.cs"
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections.Generic;
@@ -35,6 +36,7 @@
{
try
{
+ List<object> a = new List<object>();
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("MES_MESEndWorkBill_Query", 1, false, user))
{
@@ -46,11 +48,17 @@
}
ds = Sc_GetMESEndWorkBill(sWhere);
-
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ a.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = a;
return objJsonResult;
}
catch (Exception ex)
@@ -251,9 +259,40 @@
return objJsonResult;
}
- bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ DataSet Ds;
+
+ string sql1 = "exec h_p_Sc_MESEndWorkBill_BeforeDelCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + UserName + "'";
+ Ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESEndWorkBill_BeforeDelCtrl");
+ if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (Ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + Ds.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+ bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MESEndWorkBill_AfterDelCtrl", UserName, ref DBUtility.ClsPub.sExeReturnInfo);
+
if (IsDete)
{
+ oCN.Commit();//鎻愪氦浜嬪姟
+
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -262,11 +301,11 @@
}
else
{
-
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
}
@@ -276,6 +315,7 @@
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
}
--
Gitblit v1.9.1