From 8bbddac33b29a8d5091d97456622886b4fb0b022 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期四, 01 二月 2024 14:04:04 +0800 Subject: [PATCH] 删除前后控制(产量汇报单,质量汇报单,生产汇报单,开工单,完工单,停工挂起单) --- WebAPI/Controllers/生产管理/报工台工序/Sc_QualityReportStepBillController.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 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_QualityReportStepBillController.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_QualityReportStepBillController.cs" index 4611eb1..3534fb7 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_QualityReportStepBillController.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_QualityReportStepBillController.cs" @@ -296,6 +296,7 @@ return objJsonResult; } oCN.BeginTran();//寮�濮嬩簨鍔� + string HBillNo = ""; ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where HInterID=" + HItemID, "Sc_QualityReportBillMain"); ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where HInterID=" + HItemID, "Sc_QualityReportBillSub"); if (ds == null || ds.Tables[0].Rows.Count == 0) @@ -305,6 +306,10 @@ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒"; objJsonResult.data = null; return objJsonResult; ; + } + else + { + HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); } //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); //if (HStopflag) @@ -335,8 +340,58 @@ return objJsonResult; } + //鍒犻櫎鍓嶆帶鍒�========================================= + DataSet Ds; + + string sql1 = "exec h_p_Sc_QualityReportBill_BeforeDelCtrl " + HItemID + ",'" + HBillNo + "','" + user + "'"; + Ds = oCN.RunProcReturn(sql1, "h_p_Sc_QualityReportBill_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; + } + //================================================================================== + oCN.RunProc("delete from Sc_QualityReportBillMain where HInterID=" + HItemID); oCN.RunProc("delete from Sc_QualityReportBillSub where HInterID=" + HItemID); + + //鍒犻櫎鍚庢帶鍒�================================================================================== + string sql2 = "exec h_p_Sc_QualityReportBill_AfterDelCtrl " + HItemID + ",'" + HBillNo + "','" + user + "'"; + Ds = oCN.RunProcReturn(sql2, "h_p_Sc_QualityReportBill_AfterDelCtrl"); + if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); + 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; + } + //============================================================================================== + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -351,6 +406,7 @@ objJsonResult.count = 0; objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); objJsonResult.data = null; + oCN.RollBack(); return objJsonResult; } } -- Gitblit v1.9.1